Skip to content

Commit 9b16fdd

Browse files
committed
Drop configoptional changes
1 parent fcdd150 commit 9b16fdd

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

config/configoptional/optional.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,6 @@ func (o Optional[T]) HasValue() bool {
111111
return o.flavor == someFlavor
112112
}
113113

114-
// IsNone returns true if the Optional has no value.
115-
// This is the case both for the zero value and for Optional values created with None().
116-
// An Optional created with Default() or Some() is not None.
117-
//
118-
// Most callers only need [HasValue]. IsNone is useful when "not explicitly configured"
119-
// (Default) and "explicitly disabled" (None) must be treated differently — for example,
120-
// when a feature is enabled by default but can be explicitly turned off.
121-
func (o Optional[T]) IsNone() bool {
122-
return o.flavor == noneFlavor
123-
}
124-
125114
// Get returns the value of the Optional.
126115
// If the value is not present, it returns nil.
127116
func (o *Optional[T]) Get() *T {

config/configoptional/optional_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,6 @@ func TestNone(t *testing.T) {
154154
assert.Equal(t, &zeroVal, ret)
155155
}
156156

157-
func TestIsNone(t *testing.T) {
158-
assert.True(t, None[Sub]().IsNone())
159-
assert.True(t, (Optional[Sub]{}).IsNone()) // zero value is None
160-
assert.False(t, Some(Sub{}).IsNone())
161-
assert.False(t, Default(Sub{}).IsNone())
162-
}
163-
164157
func ExampleNone() {
165158
type Person struct {
166159
Name string

0 commit comments

Comments
 (0)