Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
fmt
/
tests
/
array_option_anon_struct_keep.vv
22
lines
·
19
sloc
·
247 bytes
·
8201b8a45f86edc6165ba2813bc3120c3ee4ee14
Raw
1
module main
2
3
import json
4
5
struct Data {
6
mut:
7
a_token ?[]string
8
dfv ?[]struct {
9
key string
10
}
11
}
12
13
fn main() {
14
j := '{
15
"a_token2": ["one", "two"],
16
"a_email2": {
17
"email": "
[email protected]
"
18
}
19
}'
20
d := json.decode(Data, j)!
21
println(d)
22
}
23