samber / lo

💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)
https://pkg.go.dev/github.com/samber/lo
MIT License
17.72k stars 820 forks source link

Add Same function #390

Open baozaolaoba-top opened 11 months ago

baozaolaoba-top commented 11 months ago
func Same[T comparable](list1 []T, list2 []T) bool{
  left,right := Difference(list1,list2)
  return len(left)==0 && len(right)==0
} 
MohitVachhani commented 6 months ago

The above mentioned PR might solve this out.