1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: change all '$expr' to '${expr}' (#16428)

This commit is contained in:
yuyi
2022-11-15 21:53:13 +08:00
committed by GitHub
parent 56239b4a23
commit 017ace6ea7
859 changed files with 7156 additions and 7135 deletions

View File

@ -11,11 +11,11 @@ fn main() {
port := cmdline.option(os.args, '-p', '40001').int()
mut buf := []u8{len: 100}
if is_server {
println('UDP echo server, listening for udp packets on port: $port')
mut c := net.listen_udp(':$port')!
println('UDP echo server, listening for udp packets on port: ${port}')
mut c := net.listen_udp(':${port}')!
for {
read, addr := c.read(mut buf) or { continue }
println('received $read bytes from $addr')
println('received ${read} bytes from ${addr}')
c.write_to(addr, buf[..read]) or {
println('Server: connection dropped')
continue
@ -23,7 +23,7 @@ fn main() {
}
} else {
println('UDP client, sending packets to port: ${port}.\nType `exit` to exit.')
mut c := net.dial_udp('localhost:$port')!
mut c := net.dial_udp('localhost:${port}')!
for {
mut line := os.input('client > ')
match line {