Skip to content

Commit cfa55d8

Browse files
committed
added missing method
1 parent 54314e4 commit cfa55d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

v3/field.go

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ func (f *FieldValue[T]) Get() (T, error) {
104104
return result, nil
105105
}
106106

107+
func (f *FieldValue[T]) GetOrDefault() T {
108+
value, _ := f.Get()
109+
return value
110+
}
111+
107112
func label[T FieldType]() string {
108113
switch any(*new(T)).(type) {
109114
case bool:

0 commit comments

Comments
 (0)