Skip to content

Commit dffb4d0

Browse files
committed
you're doing great
1 parent db55e18 commit dffb4d0

File tree

6 files changed

+3
-2
lines changed

6 files changed

+3
-2
lines changed

040_json/08_unmarshal_tags/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ type cities []city
2121

2222
func main() {
2323
var data cities
24+
2425
rcvd := `[{"Postal":"zip","Latitude":37.7668,"Longitude":-122.3959,"Address":"","City":"SAN FRANCISCO","State":"CA","Zip":"94107","Country":"US"},{"Postal":"zip","Latitude":37.371991,"Longitude":-122.02602,"Address":"","City":"SUNNYVALE","State":"CA","Zip":"94085","Country":"US"}]`
26+
2527
err := json.Unmarshal([]byte(rcvd), &data)
2628
if err != nil {
2729
log.Fatalln(err)

040_json/12_null/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
func main() {
10-
var a string
10+
var a []string
1111

1212
rcvd := `null`
1313
err := json.Unmarshal([]byte(rcvd), &a)

040_json/13_marshal/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"encoding/json"
55
"fmt"
6-
"os"
76
)
87

98
type model struct {

0 commit comments

Comments
 (0)