Golang常用lib收集

仉联
2023-12-01

  1. https://github.com/thedevsaddam/gojsonq

  2. http://jsoniter.com/index.cn.html
    https://github.com/json-iterator/go

  3. 比较受欢迎的json库:https://github.com/bitly/go-simplejson

  4. 单元测试:https://github.com/smartystreets/goconvey

  5. http请求:https://github.com/parnurzeal/gorequest

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"))
	}
}
 类似资料: