mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
ci: fix failing v -W build-tools
and v -W build-examples
; run vfmt.
This commit is contained in:
@@ -7,7 +7,7 @@ fn main() {
|
||||
// Make a new connection
|
||||
mut conn := net.dial_tcp('google.com:80') ?
|
||||
// Simple http HEAD request for a file
|
||||
conn.write_str('GET /index.html HTTP/1.0\r\n\r\n') ?
|
||||
conn.write_string('GET /index.html HTTP/1.0\r\n\r\n') ?
|
||||
// Wrap in a buffered reader
|
||||
mut r := io.new_buffered_reader(reader: io.make_reader(conn))
|
||||
for {
|
||||
|
@@ -5,10 +5,10 @@ fn main() {
|
||||
// Make a new connection
|
||||
mut conn := net.dial_tcp('google.com:80') ?
|
||||
defer {
|
||||
conn.close() or { }
|
||||
conn.close() or {}
|
||||
}
|
||||
// Simple http HEAD request for a file
|
||||
conn.write_str('HEAD /index.html HTTP/1.0\r\n\r\n') ?
|
||||
conn.write_string('HEAD /index.html HTTP/1.0\r\n\r\n') ?
|
||||
// Read all the data that is waiting
|
||||
result := io.read_all(reader: conn) ?
|
||||
// Cast to string and print result
|
||||
|
@@ -106,7 +106,7 @@ fn (image Image) save_as_ppm(file_name string) {
|
||||
c_r := to_int(unsafe { image.data[i] }.x)
|
||||
c_g := to_int(unsafe { image.data[i] }.y)
|
||||
c_b := to_int(unsafe { image.data[i] }.z)
|
||||
f_out.write_str('$c_r $c_g $c_b ') or { panic(err) }
|
||||
f_out.write_string('$c_r $c_g $c_b ') or { panic(err) }
|
||||
}
|
||||
f_out.close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user