Skip to content

Commit fdba24f

Browse files
author
Abraham Yusuf
committed
fix golangci-lint warnings
1 parent 724499f commit fdba24f

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.golangci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# for available options see https://golangci-lint.run/usage/configuration/
2+
linters:
3+
enable:
4+
- goimports
5+
fast: true

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DEFAULT_GOAL := build
2+
3+
lint:
4+
golangci-lint run ./...
5+
.PHONY:lint
6+
7+
build: lint
8+
echo "done"
9+
.PHONY:build

ops/once.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ func NewFnOnce[T any](f func() T) FnOnce[T] {
1414
}
1515

1616
func (p FnOnce[T]) Call() T {
17-
if p.called {
18-
return p.value
17+
if !p.called {
18+
p.value, p.called = p.callable(), true
19+
_ = p.called
1920
}
20-
p.value, p.called = p.callable(), true
2121
return p.value
2222
}

set/set.go

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func (s Set[T]) Pop() T {
160160
// Remove all elements from the set.
161161
func (s Set[T]) Clear() {
162162
s.inner = make(map[T]bool, 0)
163+
_ = s.inner
163164
}
164165

165166
// Update the set, adding elements from all others.

0 commit comments

Comments
 (0)