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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
135 changed files with 487 additions and 468 deletions

View file

@ -171,12 +171,12 @@ fn data_get() []SiteConfig {
fn data_dump(data []SiteConfig) {
a := json.encode_pretty(data)
os.write_file(os.resource_abs_path('data.json'), a) or { panic(err) }
os.write_file(os.resource_abs_path('data.json'), a) or { panic(err.msg) }
}
fn data_load() []SiteConfig {
data := os.read_file(os.resource_abs_path('data.json')) or { panic(err) }
a := json.decode([]SiteConfig, data) or { panic(err) }
data := os.read_file(os.resource_abs_path('data.json')) or { panic(err.msg) }
a := json.decode([]SiteConfig, data) or { panic(err.msg) }
return a
}
@ -192,5 +192,5 @@ fn main() {
// data_dump(data)
b := filled_in_template()
println(b)
os.write_file('result.md', b) or { panic(err) }
os.write_file('result.md', b) or { panic(err.msg) }
}