github.com/gogf/gf@v1.16.9/.example/container/glist/json_unmarshal.go (about) 1 package main 2 3 import ( 4 "encoding/json" 5 "fmt" 6 "github.com/gogf/gf/container/glist" 7 ) 8 9 func main() { 10 b := []byte(`{"Id":1,"Name":"john","Scores":[100,99,98]}`) 11 type Student struct { 12 Id int 13 Name string 14 Scores *glist.List 15 } 16 s := Student{} 17 json.Unmarshal(b, &s) 18 fmt.Println(s) 19 }