Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
gen
/
c
/
testdata
/
autofree_json_encode.vv
16
lines
·
14
sloc
·
200 bytes
·
107167a93afb952f9fdaa996c506be8c3ff52369
Raw
1
// vtest vflags: -autofree
2
import json
3
4
struct Foo {
5
foo int
6
}
7
8
fn main() {
9
mut a := {
10
'foo': 123
11
}
12
println(json.encode_pretty(a))
13
d := json.encode(a)
14
dump(d)
15
println(json.decode(Foo, d)!)
16
}
17