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

all: update repo to use the new error handling syntax (#8950)

This commit is contained in:
spaceface
2021-02-28 21:20:21 +01:00
committed by GitHub
parent b9a381f101
commit d63b7bc35a
135 changed files with 487 additions and 468 deletions

View File

@@ -156,13 +156,13 @@ fn save_raw_data_as_array(buf_bin []byte, file_name string) {
for x in buf_bin {
buf.write_string('0x${x:02x},')
}
os.write_file_array(file_name, buf.buf) or { panic(err) }
os.write_file_array(file_name, buf.buf) or { panic(err.msg) }
}
fn test_main() {
mut tf := ttf.TTF_File{}
$if create_data ? {
tf.buf = os.read_bytes(font_path) or { panic(err) }
tf.buf = os.read_bytes(font_path) or { panic(err.msg) }
println('TrueTypeFont file [$font_path] len: $tf.buf.len')
save_raw_data_as_array(tf.buf, 'test_ttf_Font_arr.bin')
} $else {
@@ -200,7 +200,7 @@ fn test_main() {
$if create_data ? {
bmp.save_as_ppm('test_ttf.ppm')
bmp.save_raw_data('test_ttf.bin')
test_buf = os.read_bytes('test_ttf.bin') or { panic(err) }
test_buf = os.read_bytes('test_ttf.bin') or { panic(err.msg) }
}
ram_buf := bmp.get_raw_bytes()