mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
16 lines
267 B
V
16 lines
267 B
V
module main
|
|
|
|
import json
|
|
import x.json2
|
|
|
|
pub struct Data {
|
|
name string
|
|
data [][]f64
|
|
}
|
|
|
|
fn test_main() {
|
|
json_data := '{"name":"test","data":[[1,2,3],[4,5,6]]}'
|
|
info := json.decode(Data, json_data)!
|
|
info2 := json2.decode[Data](json_data)!
|
|
assert info == info2
|
|
}
|