allow checking if a Provide is Nil
1 files changed, 2 insertions(+), 0 deletions(-) M di.go
M di.go => di.go +2 -0
@@ 38,6 38,7 @@ import ( type Provide[Out any] struct { fOrV any set bool Nil bool } // Optional is the canonical way of specifying a field is optional. The library @@ 99,6 100,7 @@ func NewProvide[Out any](ctorOrVal any) (Provide[Out], error) { if ctorOrVal == nil { if canBeNil(outType) { out.Nil = true return out, nil } return zero, fmt.Errorf("Provide[%v]: nil not valid for non-nilable type", outType)