mirror of
https://github.com/vlang/v.git
synced 2025-08-04 02:07:28 -04:00
11 lines
138 B
V
11 lines
138 B
V
import json
|
|
|
|
struct Test {
|
|
a string
|
|
}
|
|
|
|
fn test_main() {
|
|
x := json.decode([]&Test, '[{"a":"a"}]') or { exit(1) }
|
|
assert x[0].a == 'a'
|
|
}
|