2022-04-06 19:34:22 +03:00
|
|
|
import json
|
|
|
|
import os
|
|
|
|
|
2022-04-08 14:51:37 +03:00
|
|
|
struct DbConfig {}
|
2022-04-06 19:34:22 +03:00
|
|
|
|
2023-01-09 09:36:45 +03:00
|
|
|
fn test_json_decode_with_option_arg() {
|
2022-04-06 19:34:22 +03:00
|
|
|
if ret := print_info() {
|
|
|
|
println(ret)
|
|
|
|
} else {
|
|
|
|
println(err)
|
|
|
|
}
|
|
|
|
assert true
|
|
|
|
}
|
|
|
|
|
2022-10-26 11:26:28 +03:00
|
|
|
fn print_info() !string {
|
|
|
|
dbconf := json.decode(DbConfig, os.read_file('dbconf.json')!)!
|
2022-04-06 19:34:22 +03:00
|
|
|
println(dbconf)
|
2022-11-15 16:53:13 +03:00
|
|
|
return '${dbconf}'
|
2022-04-06 19:34:22 +03:00
|
|
|
}
|