Skip to content

Commit d0f0612

Browse files
authored
feat: adds noop mappable, useful when a map is not required but can't be nil (#5)
1 parent cb5e56d commit d0f0612

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

noopMappable.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package os_query
2+
3+
type noopMappable struct{}
4+
5+
func (n *noopMappable) Map() map[string]interface{} {
6+
return map[string]any{}
7+
}
8+
9+
func NoopMappable() *noopMappable {
10+
return &noopMappable{}
11+
}

0 commit comments

Comments
 (0)