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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user