mirror of
https://github.com/samber/lo.git
synced 2025-09-26 12:01:12 +08:00
chore: minor whitespace fixes (#677)
* lint: pin golangci-lint version * chore: minor whitespace fixes * lint: enable whitespace linter * Apply suggestions from code review --------- Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
This commit is contained in:
@@ -29,6 +29,7 @@ linters:
|
||||
- funlen
|
||||
# - wsl_v5
|
||||
- testifylint
|
||||
- whitespace
|
||||
|
||||
# disable noisy/controversial ones which you might enable later
|
||||
disable:
|
||||
@@ -77,13 +78,10 @@ linters:
|
||||
- funlen
|
||||
path: "_test\\.go$"
|
||||
|
||||
|
||||
|
||||
issues:
|
||||
max-issues-per-linter: 0 # 0 = unlimited (we want ALL issues)
|
||||
max-same-issues: 100
|
||||
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
|
@@ -851,7 +851,6 @@ The order of keys in returned map is not specified and is not guaranteed to be t
|
||||
|
||||
The third return value of the transform function is a boolean that indicates whether the key-value pair should be included in the map.
|
||||
|
||||
|
||||
```go
|
||||
list := []string{"a", "aa", "aaa"}
|
||||
|
||||
@@ -1692,7 +1691,6 @@ mean := lo.MeanBy([]float64{}, mapper)
|
||||
|
||||
[[play](https://go.dev/play/p/j7TsVwBOZ7P)]
|
||||
|
||||
|
||||
### Mode
|
||||
|
||||
Calculates the mode (most frequent value) of a collection of numbers.
|
||||
@@ -1701,7 +1699,6 @@ If multiple values have the same highest frequency, then multiple values are ret
|
||||
|
||||
If the collection is empty, the zero value of `T[]` is returned.
|
||||
|
||||
|
||||
```go
|
||||
mode := lo.Mode([]int{2, 2, 3, 4})
|
||||
// [2]
|
||||
@@ -2449,7 +2446,6 @@ Filters a slice by excluding elements whose extracted keys match any in the excl
|
||||
|
||||
Returns a new slice containing only the elements whose keys are not in the exclude list.
|
||||
|
||||
|
||||
```go
|
||||
type struct User {
|
||||
ID int
|
||||
@@ -3034,8 +3030,6 @@ lo.Sample([]string{})
|
||||
|
||||
[[play](https://go.dev/play/p/FYA45LcpfM2)]
|
||||
|
||||
|
||||
|
||||
### SampleBy
|
||||
|
||||
Returns a random item from collection, using a given random integer generator.
|
||||
@@ -3074,7 +3068,6 @@ lo.SamplesBy([]string{"a", "b", "c"}, 3, r.Intn)
|
||||
|
||||
A single line if/else statement.
|
||||
|
||||
|
||||
```go
|
||||
result := lo.Ternary(true, "a", "b")
|
||||
// "a"
|
||||
|
@@ -1,2 +1 @@
|
||||
|
||||
Credit goes to https://gopherize.me/
|
||||
Credit goes to https://gopherize.me/
|
@@ -582,6 +582,5 @@ func BenchmarkAssign(b *testing.B) {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user