Golang常用lib收集
-
http://jsoniter.com/index.cn.html
https://github.com/json-iterator/go -
比较受欢迎的json库:https://github.com/bitly/go-simplejson
func gorequestSimple(){
request := gorequest.New()
_, body, errs := request.Put("http://admin-backend.xin7c.cn/api/users/login").
Set("Content-Type", "application/json").
Send(`{"email":"xin7c@cc.ai", "password":"123456"}`).
End()
if errs == nil{
//fmt.Println("gorequestSimple:", resp)
js, _ := simplejson.NewJson([]byte(body))
fmt.Println("gorequestSimple:",js.Get("data").Get("token").MustString("tokenisnull"))
}
}
本文精选了Golang中常用的库,包括JSON处理、单元测试、HTTP请求等关键领域。推荐了如gojsonq、jsoniter、go-simplejson等热门JSON库,以及goconvey测试框架和gorequest库,为开发者提供了丰富的资源。
729

被折叠的 条评论
为什么被折叠?



