From 3210326df6338c537d427a7497275d9a0ca912fa Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Thu, 25 Sep 2025 06:48:54 +1000 Subject: [PATCH] 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 --- .golangci.yml | 4 +--- README.md | 7 ------- img/README.md | 3 +-- map_test.go | 1 - retry.go | 1 - 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 344fda2..e61c457 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -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 diff --git a/README.md b/README.md index 77506c1..d0321ac 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/img/README.md b/img/README.md index 58e9bb7..9100a33 100644 --- a/img/README.md +++ b/img/README.md @@ -1,2 +1 @@ - -Credit goes to https://gopherize.me/ +Credit goes to https://gopherize.me/ \ No newline at end of file diff --git a/map_test.go b/map_test.go index dbda26d..c9bade1 100644 --- a/map_test.go +++ b/map_test.go @@ -582,6 +582,5 @@ func BenchmarkAssign(b *testing.B) { }) } }) - } } diff --git a/retry.go b/retry.go index dd34787..488ddaf 100644 --- a/retry.go +++ b/retry.go @@ -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() {