snamiki1212/go-gen-lo

[WORKSPACE] README image

Closed this issue ยท 1 comments

code

	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}

code

	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}