Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

183 B
Raw Blame
package fn

// ValueOr returns the dereferenced value of ptr if non-nil, otherwise returns def.
func ValueOr[T any](ptr *T, def T) T {
	if ptr == nil {
		return def
	}
	return *ptr
}