How to parse a string (which is an array) in Go using json package?
type JsonType struct{ Array []string } func main(){ dataJson = `["1","2","3"]` arr := JsonType{} unmarshaled := json.Unmarshal([]byte(dataJson), &arr.Array) log.Printf("Unmarshaled: %v", unmarshaled) }
1.4m articles
1.4m replys
5 comments
57.0k users