MCPcopy Create free account
hub / github.com/google/go-github / stringOrNil

Function stringOrNil

github/repos_contents_test.go:83–88  ·  view source on GitHub ↗

stringOrNil converts a potentially null string pointer to string. For non-nil input pointer, the returned string is enclosed in double-quotes.

(s *string)

Source from the content-addressed store, hash-verified

81// stringOrNil converts a potentially null string pointer to string.
82// For non-nil input pointer, the returned string is enclosed in double-quotes.
83func stringOrNil(s *string) string {
84 if s == nil {
85 return "<nil>"
86 }
87 return fmt.Sprintf("%q", *s)
88}
89
90func TestRepositoriesService_GetReadme(t *testing.T) {
91 t.Parallel()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…