商君

导航

2018年10月30日 #

go-json处理的问题

摘要: 1、通过Decoder来解析json串 go package main import ( "encoding/json" "fmt" "io" "log" "strings" ) func main() { const jsonStream = ` {"Name":"Ed","Text":"Knoc 阅读全文

posted @ 2018-10-30 19:24 漫步者01 阅读(451) 评论(0) 推荐(0)

Go断言

摘要: golang的语言中提供了断言的功能。golang中的所有程序都实现了interface{}的接口,这意味着,所有的类型如string,int,int64甚至是自定义的struct类型都就此拥有了interface{}的接口,这种做法和java中的Object类型比较类似。那么在一个数据通过func 阅读全文

posted @ 2018-10-30 11:38 漫步者01 阅读(368) 评论(0) 推荐(0)