[WORKSPACE] README image
Closed this issue ยท 1 comments
snamiki1212 commented
us := Users{{UserID: "1"}, {UserID: "2"}, {UserID: "3"}}
// ๐ You can use lo with slice method
u, _ := us.Find(func(entity User) bool { return entity.UserID == "2" })
fmt.Println(u) // {UserID:2}
snamiki1212 commented
us := Users{{UserID: "1"}, {UserID: "2"}, {UserID: "3"}}
// ๐ You can use samber/lo with slice method
u, _ := us.Find(func(entity User) bool { return entity.UserID == "2" })
fmt.Println(u) // {UserID:2}
// ๐ You can use Extended samber/lo
u, _ = us.FindByUserID("3")
fmt.Println(u) // {UserID:3}