- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for NonEmptyOrDefault (0.19 sec)
-
pkg/ptr/pointer.go
return empty } // OrDefault returns *t if its non-nil, or else def. func OrDefault[T any](t *T, def T) T { if t != nil { return *t } return def } // NonEmptyOrDefault returns t if its non-empty, or else def. func NonEmptyOrDefault[T comparable](t T, def T) T { var empty T if t != empty { return t } return def } // Empty returns an empty T type func Empty[T any]() T { var empty T
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Sun Apr 07 14:56:54 UTC 2024 - 1.8K bytes - Viewed (0) -
pkg/config/mesh/mesh.go
if ph != nil && orig != nil { ph.ForwardedClientCert = ptr.NonEmptyOrDefault(ph.ForwardedClientCert, orig.ForwardedClientCert) ph.RequestId = ptr.NonEmptyOrDefault(ph.RequestId, orig.RequestId) ph.AttemptCount = ptr.NonEmptyOrDefault(ph.AttemptCount, orig.AttemptCount) ph.Server = ptr.NonEmptyOrDefault(ph.Server, orig.Server) ph.EnvoyDebugHeaders = ptr.NonEmptyOrDefault(ph.EnvoyDebugHeaders, orig.EnvoyDebugHeaders) } }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Wed Apr 17 20:06:41 UTC 2024 - 12K bytes - Viewed (0)