Skip to content

Commit 4699fdc

Browse files
committed
ref: add Exist() method on mopts
1 parent 1ca2e14 commit 4699fdc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mopts/mopts.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ func (c MoptionContainer[T]) Set(k T, v any) {
88
c[k] = v
99
}
1010

11+
func (c MoptionContainer[T]) Exist(k T) bool {
12+
_, ok := c[k]
13+
return ok
14+
}
15+
1116
func (c MoptionContainer[T]) Get(k T) any {
1217
return c[k]
1318
}

0 commit comments

Comments
 (0)