| 1 | import json |
| 2 | import os |
| 3 | |
| 4 | struct DbConfig {} |
| 5 | |
| 6 | fn test_json_decode_with_option_arg() { |
| 7 | if ret := print_info() { |
| 8 | println(ret) |
| 9 | } else { |
| 10 | println(err) |
| 11 | } |
| 12 | assert true |
| 13 | } |
| 14 | |
| 15 | fn print_info() !string { |
| 16 | dbconf := json.decode(DbConfig, os.read_file('dbconf.json')!)! |
| 17 | println(dbconf) |
| 18 | return '${dbconf}' |
| 19 | } |
| 20 |