https://github.com/terraform-providers/terraform-provider-github/blob/master/github/config.go
ctx := context.Background() insecureClient := &http.Client{ Transport: &http.Transport{ TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, }, }, } ctx = context.WithValue(ctx, oauth2.HTTPClient, insecureClient) client := oauth2.NewClient(ctx, oauth2.StaticTokenSource(&oauth2.Token{ AccessToken: c.Param("accesstoken"), TokenType: "Bearer", })) resp, err := client.Get("https://ory-hydra-login-consent:9020/openid/userinfo") if err != nil { return newHTTPError(400, "InvalidToken", err.Error()) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { return newHTTPError(400, "InvalidToken", err.Error()) } c.Logger().Debugf("resp: %s", body) var t map[string]interface{} err = json.Unmarshal(body, &t) if err !
https://medium.com/@ryanyang1221/%E8%AE%93-google-%E6%95%99%E4%BD%A0-code-review-be251d4d81b4
func covertStringByte32(t string) [32]byte { var b32 [32]byte copy(b32[:], []byte(t)) return b32 } func covertStringByte64(t string) [64]byte { var b64 [64]byte copy(b64[:], []byte(t)) return b64 }
httpexpect star 1159
https://github.com/gavv/httpexpect
https://github.com/gavv/httpexpect/blob/master/_examples/echo_test.go
goconvey
https://segmentfault.com/a/1190000014924022
https://github.com/smartystreets/goconvey/
baloo star 652
https://github.com/h2non/baloo
frisby star 249
https://github.com/verdverm/frisby
apitest star 121
https://github.com/steinfletcher/apitest
https://segmentfault.com/a/1190000020185565
https://segmentfault.com/a/1190000020086749
https://stackoverflow.com/questions/52079662/go-get-cannot-find-local-packages-when-using-multiple-modules-in-a-repo
api/contracts/contract.go package contracts import ( "math/big" "strings" ).... func DeployContract(...) api/contract.go package main import ( "api/contracts" ...) func deployContract(c echo.Context) error { address, tx, token, err := contracts.DeployContract(auth, client) ... } ! Best Import is api/go.mod module api require ( api/contracts v0.0.0 ...) replace ( api/contracts v0.0.0 => ./contracts ...) And api/contracts/go.mod module api/contracts require ( ...) ``` ` `` ``````