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) }
2.1m questions
2.1m answers
60 comments
57.0k users