MCPcopy Index your code
hub / github.com/google/go-github / mustNewClient

Function mustNewClient

github/github_test.go:49–56  ·  view source on GitHub ↗

mustNewClient is a helper function that creates a new Client and fails the test if there is an error.

(t *testing.T, opts ...ClientOptionsFunc)

Source from the content-addressed store, hash-verified

47
48// mustNewClient is a helper function that creates a new Client and fails the test if there is an error.
49func mustNewClient(t *testing.T, opts ...ClientOptionsFunc) *Client {
50 t.Helper()
51 c, err := NewClient(opts...)
52 if err != nil {
53 t.Fatal(err)
54 }
55 return c
56}
57
58// mustParseURL is a helper function that parses a URL and fails the test if there is an error.
59func mustParseURL(t *testing.T, rawurl string) *url.URL {

Callers 15

setupFunction · 0.85
TestClient_UserAgentFunction · 0.85
TestClient_BaseURLFunction · 0.85
TestClient_UploadURLFunction · 0.85
TestClient_CloneFunction · 0.85
TestNewRequestFunction · 0.85
TestNewRequest_badURLFunction · 0.85
TestNewRequest_badMethodFunction · 0.85
TestNewRequest_emptyBodyFunction · 0.85

Calls 1

NewClientFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…