revert json.UnmarshalUseNumber to json.Unmarshal for code in the example folder

This commit is contained in:
John Guo 2021-05-15 23:13:31 +08:00
parent 8aed1eca13
commit d12409b118
9 changed files with 9 additions and 9 deletions

View File

@ -14,6 +14,6 @@ func main() {
Scores *garray.IntArray
}
s := Student{}
json.UnmarshalUseNumber(b, &s)
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -14,6 +14,6 @@ func main() {
Scores *glist.List
}
s := Student{}
json.UnmarshalUseNumber(b, &s)
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -9,6 +9,6 @@ import (
func main() {
m := gmap.Map{}
s := []byte(`{"name":"john","score":100}`)
json.UnmarshalUseNumber(s, &m)
json.Unmarshal(s, &m)
fmt.Println(m.Map())
}

View File

@ -14,6 +14,6 @@ func main() {
Scores *gset.IntSet
}
s := Student{}
json.UnmarshalUseNumber(b, &s)
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -14,6 +14,6 @@ func main() {
Scores *gtype.Interface
}
s := Student{}
json.UnmarshalUseNumber(b, &s)
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -14,6 +14,6 @@ func main() {
Scores *g.Var
}
s := Student{}
json.UnmarshalUseNumber(b, &s)
json.Unmarshal(b, &s)
fmt.Println(s)
}

View File

@ -140,7 +140,7 @@ var data = `{
func main() {
struct1 := new(XinYanModel)
err := json.UnmarshalUseNumber([]byte(data), struct1)
err := json.Unmarshal([]byte(data), struct1)
fmt.Println(err)
fmt.Println(struct1)

View File

@ -30,7 +30,7 @@ func RecvPkg(conn *gtcp.Conn) (msg *types.Msg, err error) {
return nil, err
} else {
msg = &types.Msg{}
err = json.UnmarshalUseNumber(data, msg)
err = json.Unmarshal(data, msg)
if err != nil {
return nil, fmt.Errorf("invalid package structure: %s", err.Error())
}

View File

@ -21,7 +21,7 @@ func main() {
break
}
info := &types.NodeInfo{}
if err := json.UnmarshalUseNumber(data, info); err != nil {
if err := json.Unmarshal(data, info); err != nil {
glog.Errorf("invalid package structure: %s", err.Error())
} else {
glog.Println(info)