go get github.com/birjemin/wxgameod
- 示例
httpClient := &utils.HTTPClient{
Client: &http.Client{
Timeout: 5 * time.Second,
},
}
var m = SetUserStorage{
AccessToken: "ACCESS_TOKEN",
SessionKey: "SESSION_KEY",
OpenID: "OPEN_ID",
KvList: "{\"kv_list\":[{\"key\":\"1\",\"value\":\"0\"}]}",
HTTPRequest: httpClient,
}
if ret, err := m.doSetUserStorage(ts.URL); err != nil {
t.Error(err)
} else {
if ret.ErrCode != 0 {
t.Error(errors.New("msg: " + ret.ErrMsg))
}
}
- 测试
go test
- 格式化代码
golint
- 覆盖率
go test -cover go test -coverprofile=coverage.out go tool cover -html=coverage.out
无