MCPcopy Create free account
hub / github.com/imroc/req / valueOrDefault

Function valueOrDefault

http_request.go:61–66  ·  view source on GitHub ↗

Return value if nonempty, def otherwise.

(value, def string)

Source from the content-addressed store, hash-verified

59
60// Return value if nonempty, def otherwise.
61func valueOrDefault(value, def string) string {
62 if value != "" {
63 return value
64 }
65 return def
66}
67
68// outgoingLength reports the Content-Length of this outgoing (Client) request.
69// It maps 0 into -1 (unknown) when the Body is non-nil.

Callers 3

isReplayableFunction · 0.85
writeRequestMethod · 0.85
newTransferWriterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…