package main
import (
"fmt"
"github.com/samber/lo/mutable"
)
type el struct {
Key string
Val any
}
func main() {
doc := []el{
{"foo", 234},
{"bar", 345},
{"baz", 111},
}
mutable.Filter(
doc,
func(e el) bool {
return e.Key != "bar"
},
)
fmt.Printf("Hello, World! %+v", doc)
}
Hello, World! [{Key:foo Val:234} {Key:baz Val:111} {Key:baz Val:111}]