Skip to content

Commit eb43902

Browse files
authored
Bump go to 1.23 (#28)
1 parent fca8d50 commit eb43902

File tree

8 files changed

+101
-593
lines changed

8 files changed

+101
-593
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
name: Lint
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3434

35-
- uses: actions/setup-go@v3
35+
- uses: actions/setup-go@v5
3636
with:
3737
cache: true
3838
go-version-file: "go.mod"
@@ -44,7 +44,7 @@ jobs:
4444
name: Build
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4848

4949
- name: Run build
5050
run: make build

.golangci.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
linters:
22
disable-all: true
33
enable:
4-
- deadcode
54
- goconst
65
- gofmt
76
- revive
@@ -10,23 +9,18 @@ linters:
109
- misspell
1110
- staticcheck
1211
- unconvert
13-
- varcheck
14-
- vet
15-
- vetshadow
1612
- errcheck
1713
- govet
18-
- structcheck
1914
- typecheck
2015
- gocritic
16+
- unused
17+
- gci
2118

2219
run:
2320

2421
# timeout for analysis
2522
timeout: 5m
2623

27-
skip-dirs:
28-
- hack
29-
3024
linters-settings:
3125
revive:
3226
rules:
@@ -39,8 +33,19 @@ linters-settings:
3933
disabled-checks:
4034
- commentFormatting # we dont want to enforce space before the comment text
4135

42-
issues:
36+
gci:
37+
sections:
38+
- standard
39+
- prefix(github.com/v3io/sidecar-proxy)
40+
- default
41+
- blank
42+
- dot
4343

44+
custom-order: true
45+
46+
issues:
47+
exclude-dirs:
48+
- hack
4449
# List of regexps of issue texts to exclude
4550
exclude:
4651
- "comment on"
@@ -52,3 +57,4 @@ issues:
5257
- path: _test\.go
5358
linters:
5459
- goconst
60+
version: 2

Makefile

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
LABEL ?= unstable
22
REPOSITORY ?= gcr.io/iguazio
33
IMAGE = $(REPOSITORY)/sidecar-proxy:$(LABEL)
4+
GOPATH ?= $(shell go env GOPATH)
45

56
.PHONY: build
67
build:
@@ -13,15 +14,44 @@ build:
1314
push:
1415
docker push $(IMAGE)
1516

16-
.PHONY: lint
17-
lint:
18-
./hack/lint/install.sh
19-
./hack/lint/run.sh
20-
21-
.PHONY: fmt
22-
fmt:
23-
@go fmt $(shell go list ./... | grep -v /vendor/)
24-
2517
.PHONY: test
2618
test:
2719
go test -p1 -v ./pkg/...
20+
21+
GOLANGCI_LINT_VERSION := v1.64.6
22+
GOLANGCI_LINT_BIN := $(GOPATH)/bin/golangci-lint
23+
GOLANGCI_LINT_INSTALL_COMMAND := GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
24+
25+
.PHONY: ensure-golangci-linter
26+
ensure-golangci-linter:
27+
@if ! command -v $(GOLANGCI_LINT_BIN) >/dev/null 2>&1; then \
28+
echo "golangci-lint not found. Installing..."; \
29+
$(GOLANGCI_LINT_INSTALL_COMMAND); \
30+
else \
31+
installed_version=$$($(GOLANGCI_LINT_BIN) version | awk '/version/ {print $$4}'); \
32+
if [ "$$installed_version" != "$(GOLANGCI_LINT_VERSION)" ]; then \
33+
echo "golangci-lint version mismatch ($$installed_version != $(GOLANGCI_LINT_VERSION)). Reinstalling..."; \
34+
$(GOLANGCI_LINT_INSTALL_COMMAND); \
35+
fi \
36+
fi
37+
38+
.PHONY: ensure-gopath
39+
ensure-gopath:
40+
ifndef GOPATH
41+
$(error GOPATH must be set)
42+
endif
43+
44+
.PHONY: modules
45+
modules: ensure-gopath
46+
@go mod download
47+
48+
.PHONY: fmt
49+
fmt: ensure-golangci-linter
50+
gofmt -s -w .
51+
$(GOPATH)/bin/golangci-lint run --fix
52+
53+
.PHONY: lint
54+
lint: modules ensure-golangci-linter
55+
@echo Linting...
56+
$(GOPATH)/bin/golangci-lint run -v
57+
@echo Done.

cmd/sidecarproxy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
FROM gcr.io/iguazio/golang:1.19 as builder
15+
FROM gcr.io/iguazio/golang:1.23 as builder
1616

1717
# copy source tree
1818
WORKDIR /sidecar-proxy

go.mod

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
module github.com/v3io/sidecar-proxy
22

3-
go 1.19
3+
go 1.23
44

55
require (
66
github.com/nuclio/errors v0.0.4
77
github.com/nuclio/logger v0.0.1
88
github.com/nuclio/loggerus v0.0.6
9-
github.com/prometheus/client_golang v1.14.0
10-
github.com/sirupsen/logrus v1.9.0
9+
github.com/prometheus/client_golang v1.22.0
10+
github.com/sirupsen/logrus v1.9.3
1111
)
1212

1313
require (
1414
github.com/beorn7/perks v1.0.1 // indirect
15-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
16-
github.com/golang/protobuf v1.5.2 // indirect
15+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1716
github.com/logrusorgru/aurora/v3 v3.0.0 // indirect
18-
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
19-
github.com/prometheus/client_model v0.3.0 // indirect
20-
github.com/prometheus/common v0.37.0 // indirect
21-
github.com/prometheus/procfs v0.8.0 // indirect
22-
golang.org/x/sys v0.4.0 // indirect
23-
google.golang.org/protobuf v1.33.0 // indirect
17+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
18+
github.com/prometheus/client_model v0.6.1 // indirect
19+
github.com/prometheus/common v0.62.0 // indirect
20+
github.com/prometheus/procfs v0.15.1 // indirect
21+
golang.org/x/sys v0.30.0 // indirect
22+
google.golang.org/protobuf v1.36.6 // indirect
2423
)

0 commit comments

Comments
 (0)