MCPcopy Index your code
hub / github.com/coder/coder / NilOrEmpty

Function NilOrEmpty

coderd/util/ptr/ptr.go:16–18  ·  view source on GitHub ↗

NilOrEmpty returns true if s is nil or the empty string.

(s *string)

Source from the content-addressed store, hash-verified

14
15// NilOrEmpty returns true if s is nil or the empty string.
16func NilOrEmpty(s *string) bool {
17 return s == nil || *s == ""
18}
19
20// NilToEmpty coalesces a nil value to the empty value.
21func NilToEmpty[T any](s *T) T {

Callers 3

validWorkspaceScheduleFunction · 0.92
Test_NilOrEmptyFunction · 0.92

Calls

no outgoing calls

Tested by 1

Test_NilOrEmptyFunction · 0.74