-
-
Notifications
You must be signed in to change notification settings - Fork 938
Open
Description
https://goplay.tools/snippet/n4gxxXL3Tge
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)
}
outputs:
Hello, World! [{Key:foo Val:234} {Key:baz Val:111} {Key:baz Val:111}]
Note the duplicated baz.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels