mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: change optional to option (#16914)
This commit is contained in:
19
vlib/json/json_decode_with_option_arg_test.v
Normal file
19
vlib/json/json_decode_with_option_arg_test.v
Normal file
@ -0,0 +1,19 @@
|
||||
import json
|
||||
import os
|
||||
|
||||
struct DbConfig {}
|
||||
|
||||
fn test_json_decode_with_option_arg() {
|
||||
if ret := print_info() {
|
||||
println(ret)
|
||||
} else {
|
||||
println(err)
|
||||
}
|
||||
assert true
|
||||
}
|
||||
|
||||
fn print_info() !string {
|
||||
dbconf := json.decode(DbConfig, os.read_file('dbconf.json')!)!
|
||||
println(dbconf)
|
||||
return '${dbconf}'
|
||||
}
|
Reference in New Issue
Block a user