Skip to content

Commit cd28bbb

Browse files
committed
update linter version
1 parent 06f80a8 commit cd28bbb

File tree

5 files changed

+62
-65
lines changed

5 files changed

+62
-65
lines changed

.golangci.yml

+54-59
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,63 @@
11
linters-settings:
2-
govet:
3-
check-shadowing: true
4-
golint:
5-
min-confidence: 0
6-
gocyclo:
7-
min-complexity: 16
8-
maligned:
9-
suggest-new: true
10-
dupl:
11-
threshold: 200
12-
goconst:
13-
min-len: 2
14-
min-occurrences: 2
15-
misspell:
16-
locale: US
17-
lll:
18-
line-length: 140
19-
gocritic:
20-
enabled-tags:
21-
- performance
22-
- style
23-
- experimental
24-
disabled-checks:
25-
- wrapperFunc
26-
- hugeParam
27-
- rangeValCopy
2+
govet:
3+
check-shadowing: true
4+
gocyclo:
5+
min-complexity: 16
6+
dupl:
7+
threshold: 200
8+
goconst:
9+
min-len: 2
10+
min-occurrences: 2
11+
misspell:
12+
locale: US
13+
lll:
14+
line-length: 140
15+
gocritic:
16+
enabled-tags:
17+
- performance
18+
- style
19+
- experimental
20+
disabled-checks:
21+
- wrapperFunc
22+
- hugeParam
23+
- rangeValCopy
24+
revive:
25+
min-confidence: 0
2826

2927
linters:
30-
disable-all: true
31-
enable:
32-
- deadcode
33-
- dupl
34-
- gas
35-
- gocritic
36-
- gocyclo
37-
- golint
38-
- gosimple
39-
- govet
40-
- ineffassign
41-
- maligned
42-
- megacheck
43-
- misspell
44-
- nakedret
45-
- prealloc
46-
- scopelint
47-
- structcheck
48-
- stylecheck
49-
- typecheck
50-
- unconvert
51-
- unparam
52-
- varcheck
53-
fast: false
28+
disable-all: true
29+
enable:
30+
- unused
31+
- dupl
32+
- gosec
33+
# - gocritic # Temporarily disabled due to compatibility issues with Go 1.24
34+
- gocyclo
35+
- revive
36+
- gosimple
37+
- govet
38+
- ineffassign
39+
- staticcheck
40+
- misspell
41+
- nakedret
42+
- prealloc
43+
- exportloopref
44+
- stylecheck
45+
- typecheck
46+
- unconvert
47+
- unparam
48+
fast: false
5449

5550
run:
56-
skip-dirs:
57-
- vendor
58-
concurrency: 4
51+
skip-dirs:
52+
- vendor
53+
concurrency: 4
5954

6055
issues:
61-
exclude-rules:
62-
- text: "weak cryptographic primitive"
63-
linters:
64-
- gosec
65-
exclude-use-default: false
56+
exclude-rules:
57+
- text: "weak cryptographic primitive"
58+
linters:
59+
- gosec
60+
exclude-use-default: false
6661

6762
service:
68-
golangci-lint-version: 1.54.2
63+
golangci-lint-version: 1.64.2

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ build: $(TARGET) check-go ## builds and installs binary in bin/
3636

3737
check-go:
3838
ifndef GOPATH
39-
$(error "go is not available please install golang version 1.21.0+, https://golang.org/dl/")
39+
$(error "go is not available please install golang version 1.24.0+, https://golang.org/dl/")
4040
endif
4141

4242
clean: check-go ## runs `go clean` and removes the bin/ dir
@@ -50,9 +50,11 @@ cover-html: cover ## generates test coverage html report
5050
$(GOCMD) tool cover -html=$(COVER_FILE)
5151

5252
setup: check-go ## installs all dev and ci dependencies, but does not install golang
53-
## "go get" won't work for newer go versions, need to use "go install github.com/rakyll/statik"
53+
## Install golangci-lint
54+
## golangci-lint is not yet fully supporting gl v1.24, need to wait a bit. Should work after some time
55+
## skip linting until then
5456
ifeq (,$(wildcard $(GOLINT)))
55-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOPATH)/bin v1.54.2
57+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.64.2
5658
endif
5759
## "go get" won't work for newer go versions, need to use "go install github.com/rakyll/statik"
5860
ifeq (,$(wildcard $(GOPATH)/bin/statik))

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Refer to the [Agent's developer documentation](https://docs.developers.optimizel
1515

1616
### Requirements
1717

18-
Optimizely Agent is implemented in [Golang](https://golang.org/). Golang version 1.21.0+ is required for developing and compiling from source.
18+
Optimizely Agent is implemented in [Golang](https://golang.org/). Golang version 1.24.0+ is required for developing and compiling from source.
1919
Installers and binary archives for most platforms can be downloaded directly from the Go [downloads](https://go.dev/dl/) page.
2020

2121
### Run from source (Linux / OSX)

scripts/build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function main($mode) {
102102
# noninteractive mode: ./build.ps1 noninteractive (default: interactive)
103103

104104
# check if go is installed, if not, install it.
105-
checkPrereq 'Go Programming Language amd64 go1.20.1' https://dl.google.com/go/go1.20.1.windows-amd64.msi f06fdfa56f3aba62cbf80dacddbcc1150f4990cc117a9477047d3a3529ee3e80 $mode
105+
checkPrereq 'Go Programming Language amd64 go1.20.1' https://dl.google.com/go/go1.24.0.windows-amd64.msi f06fdfa56f3aba62cbf80dacddbcc1150f4990cc117a9477047d3a3529ee3e80 $mode
106106
# same but with git
107107
checkPrereq 'Git version 2.39.2' https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe d7608fbd854b3689102ff48b03c8cc77b35138f9f7350d134306da0ba5751464 $mode
108108

scripts/dockerfiles/Dockerfile.alpine

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG GO_VERSION
22
FROM golang:$GO_VERSION-alpine3.21 as builder
3-
# hadolint ignore=DL3018 - test comment
3+
# hadolint ignore=DL3018
44
RUN addgroup -S agentgroup && adduser -S agentuser -G agentgroup
55
RUN apk add --no-cache make gcc libc-dev git curl
66
WORKDIR /go/src/github.com/optimizely/agent

0 commit comments

Comments
 (0)