| 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 | |