Skip to content

Commit 38fc535

Browse files
committed
fix linting
1 parent fd78077 commit 38fc535

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ markdown:
3838
## lint: 🚨 Run lint checks
3939
.PHONY: lint
4040
lint:
41-
@which golangci-lint > /dev/null || $(MAKE) install-lint
42-
golangci-lint run
43-
44-
## install-lint: 🛠 Install golangci-lint
45-
.PHONY: install-lint
46-
install-lint:
47-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v1.64.7
41+
GOTOOLCHAIN=$(TOOLCHAIN) go run github.com/golangci/golangci-lint/cmd/[email protected] run ./...
4842

4943
## modernize: 🛠 Run gopls modernize
5044
.PHONY: modernize

app_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ func Test_App_GetBytes(t *testing.T) {
10111011
b := []byte("fiber")
10121012
appMutable := New()
10131013
same := appMutable.GetBytes(b)
1014-
if unsafe.SliceData(same) != unsafe.SliceData(b) {
1014+
if unsafe.SliceData(same) != unsafe.SliceData(b) { //nolint:gosec // compare pointer addresses
10151015
t.Errorf("expected original slice when immutable is disabled")
10161016
}
10171017

@@ -1020,14 +1020,14 @@ if unsafe.SliceData(same) != unsafe.SliceData(b) {
10201020
sub := alias[:5]
10211021
appImmutable := New(Config{Immutable: true})
10221022
copied := appImmutable.GetBytes(sub)
1023-
if unsafe.SliceData(copied) == unsafe.SliceData(sub) {
1023+
if unsafe.SliceData(copied) == unsafe.SliceData(sub) { //nolint:gosec // compare pointer addresses
10241024
t.Errorf("expected a copy for aliased slice when immutable is enabled")
10251025
}
10261026

10271027
full := make([]byte, 5)
10281028
copy(full, b)
10291029
detached := appImmutable.GetBytes(full)
1030-
if unsafe.SliceData(detached) == unsafe.SliceData(full) {
1030+
if unsafe.SliceData(detached) == unsafe.SliceData(full) { //nolint:gosec // compare pointer addresses
10311031
t.Errorf("expected a copy even when cap==len")
10321032
}
10331033
}

0 commit comments

Comments
 (0)