mirror of
https://github.com/samber/lo.git
synced 2025-09-26 20:11:13 +08:00
fix: minor example issues (#676)
* lint: pin golangci-lint version * fix: minor example issues * Update lint.yml --------- Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
This commit is contained in:
@@ -28,7 +28,7 @@ func ExampleWithoutBy() {
|
||||
filteredUsers := WithoutBy(users, extractID, excludedIDs...)
|
||||
|
||||
// output the filtered users
|
||||
fmt.Printf("%v\n", filteredUsers)
|
||||
fmt.Printf("%v", filteredUsers)
|
||||
// Output:
|
||||
// [{1 Alice}]
|
||||
}
|
||||
|
@@ -217,7 +217,7 @@ func ExampleMapEntries() {
|
||||
return v, k
|
||||
})
|
||||
|
||||
fmt.Printf("%v\n", result)
|
||||
fmt.Printf("%v", result)
|
||||
// Output: map[1:foo 2:bar]
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ func ExampleMapToSlice() {
|
||||
return fmt.Sprintf("%d_%d", k, v)
|
||||
})
|
||||
|
||||
sort.StringSlice(result).Sort()
|
||||
sort.Strings(result)
|
||||
fmt.Printf("%v", result)
|
||||
// Output: [1_1 2_2 3_3 4_4]
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func ExampleFilterMapToSlice() {
|
||||
return fmt.Sprintf("%d_%d", k, v), k%2 == 0
|
||||
})
|
||||
|
||||
sort.StringSlice(result).Sort()
|
||||
sort.Strings(result)
|
||||
fmt.Printf("%v", result)
|
||||
// Output: [2_2 4_4]
|
||||
}
|
||||
|
@@ -508,7 +508,7 @@ func ExampleReplace() {
|
||||
// [42 1 42 1 2 3 42]
|
||||
}
|
||||
|
||||
func ExampleReplaceAll() {
|
||||
func ExampleCompact() {
|
||||
list := []string{"", "foo", "", "bar", ""}
|
||||
|
||||
result := Compact(list)
|
||||
|
Reference in New Issue
Block a user