mirror of
https://github.com/vlang/v.git
synced 2025-08-04 02:07:28 -04:00
17 lines
267 B
V
17 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
|
|
}
|