愿意为你解答关于简书钻的一切疑问~<br><br>买简书会员 <a href="https://www.jianshu.com/mobile/club?ref=676146d9" target="_blank">https://www.jianshu.com/mobile/club?ref=676146d9</a>
![240](https://cdn2.jianshu.io/assets/default_avatar/5-33d2da32c552b8be9a0548c7a4576607.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240)
IP属地:四川
呵呵,这故事。。。就是渣男喝多了发的梦呓。逻辑和惯性除非他修炼了前坤大罗移😬
func main() {
s1 := "[1,2,3,4]";
s2 := "{\"a\":1, \"b\":2}";
s3 := "\"Hello\""
s4 := "1024"
s5 := "true"
s6 := "null"
a := []string{s1, s2, s3, s4, s5, s6}
var result interface{}
for _, s := range a {
json.Unmarshal([]byte(s), &result)
fmt.Println(reflect.TypeOf(result), result)
}
}
Go语言:读取一个未知的Json(支持数组型Json)代码实例: