Files
go-easy-utils/mapx/exists_example_test.go
2025-07-08 15:26:54 +08:00

30 lines
347 B
Go

package mapx
import "fmt"
func ExampleKeyExists() {
m := map[string]string{
"foo": "bar",
"baz": "123",
}
res := KeyExists(m, "foo")
fmt.Println(res)
// Output:
// true
}
func ExampleValueExists() {
m := map[string]string{
"foo": "bar",
"baz": "123",
}
res := ValueExists(m, "123")
fmt.Println(res)
// Output:
// true
}