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:
Nathan Baulch
2025-09-25 06:48:54 +10:00
committed by GitHub
parent 7170719ec0
commit 3210326df6
5 changed files with 2 additions and 14 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -1,2 +1 @@
Credit goes to https://gopherize.me/

View File

@@ -582,6 +582,5 @@ func BenchmarkAssign(b *testing.B) {
})
}
})
}
}

View File

@@ -323,7 +323,6 @@ func (th *throttleBy[T]) throttledFunc(key T) {
for _, f := range th.callbacks {
f(key)
}
}
if th.timer == nil {
th.timer = time.AfterFunc(th.interval, func() {