1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

fix: fix go lint issue

This commit is contained in:
dudaodong
2025-07-07 11:18:34 +08:00
parent a81403766f
commit d5b9e67330
2 changed files with 2 additions and 2 deletions

View File

@@ -831,7 +831,7 @@ func ExampleUniqueByComparator() {
})
caseInsensitiveStrings := UniqueByComparator([]string{"apple", "banana", "Apple", "cherry", "Banana", "date"}, func(item string, other string) bool {
return strings.ToLower(item) == strings.ToLower(other)
return strings.EqualFold(item, other)
})
fmt.Println(uniqueNums)

View File

@@ -1008,7 +1008,7 @@ func TestUniqueByComparator(t *testing.T) {
t.Run("case-insensitive string comparison", func(t *testing.T) {
stringSlice := []string{"apple", "banana", "Apple", "cherry", "Banana", "date"}
caseInsensitiveComparator := func(item, other string) bool {
return strings.ToLower(item) == strings.ToLower(other)
return strings.EqualFold(item, other)
}
result := UniqueByComparator(stringSlice, caseInsensitiveComparator)