Skip to content

Commit a568275

Browse files
committed
feat: bump go to 1.24 and tool deps
use native go tool directive bump tool dependencies fix linter issues run terraform-docs
1 parent 1092246 commit a568275

File tree

20 files changed

+2111
-494
lines changed

20 files changed

+2111
-494
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ updates:
99
aws:
1010
patterns:
1111
- "github.com/aws/*"
12-
# go tools
13-
- package-ecosystem: "gomod"
14-
directory: "tools/"
15-
schedule:
16-
interval: "weekly"
1712

1813
# GitHub actions
1914
- package-ecosystem: "github-actions"

.golangci.yml

Lines changed: 67 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,39 @@
1-
service:
2-
golangci-lint-version: 1.59.x
3-
4-
issues:
5-
exclude-dirs:
6-
- artifacts
7-
- build-targets
8-
- design
9-
- docker-images
10-
- docs
11-
- etc
12-
- experiments
13-
- infrastructure
14-
- legal
15-
- libpf-rs
16-
- mocks
17-
- pf-code-indexing-service/cibackend/gomock_*
18-
- pf-debug-metadata-service/dmsbackend/gomock_*
19-
- pf-host-agent/support/ci-kernels
20-
- pf-storage-backend/storagebackend/gomock_*
21-
- scratch
22-
- systemtests/benchmarks/_outdata
23-
- target
24-
- virt-tests
25-
- vm-images
26-
1+
version: "2"
272
linters:
28-
enable-all: true
3+
default: all
294
disable:
30-
# Disabled because of
31-
# - too many non-sensical warnings
32-
# - not relevant for us
33-
# - false positives
34-
#
35-
# "might be worth fixing" means we should investigate/fix in the mid term
365
- canonicalheader
37-
- contextcheck # might be worth fixing
6+
- contextcheck
7+
- copyloopvar
388
- cyclop
399
- depguard
4010
- dupword
4111
- err113
42-
- errorlint # might be worth fixing
12+
- errorlint
4313
- exhaustive
4414
- exhaustruct
4515
- forbidigo
46-
- forcetypeassert # might be worth fixing
16+
- forcetypeassert
4717
- funlen
48-
- gci # might be worth fixing
4918
- gochecknoglobals
5019
- gochecknoinits
5120
- gocognit
5221
- goconst
5322
- gocyclo
5423
- godot
55-
- godox # complains about TODO etc
56-
- gofumpt
24+
- godox
5725
- gomoddirectives
5826
- inamedparam
5927
- interfacebloat
28+
- intrange
6029
- ireturn
6130
- lll
6231
- maintidx
6332
- makezero
6433
- mnd
6534
- nestif
6635
- nlreturn
67-
- noctx # might be worth fixing
36+
- noctx
6837
- nonamedreturns
6938
- paralleltest
7039
- protogetter
@@ -74,47 +43,62 @@ linters:
7443
- thelper
7544
- varnamelen
7645
- wastedassign
77-
- wsl
7846
- wrapcheck
79-
# we don't want to change code to Go 1.22+ yet
80-
- intrange
81-
- copyloopvar
82-
83-
linters-settings:
84-
goconst:
85-
min-len: 2
86-
min-occurrences: 2
87-
gocritic:
88-
enabled-tags:
89-
- diagnostic
90-
- experimental
91-
- opinionated
92-
- performance
93-
- style
94-
disabled-checks:
95-
- dupImport # https://github.com/go-critic/go-critic/issues/845
96-
- ifElseChain
97-
- whyNoLint
98-
- sloppyReassign
99-
- uncheckedInlineErr # Experimental rule with high false positive rate.
100-
101-
# Broken with Go 1.18 feature (https://github.com/golangci/golangci-lint/issues/2649):
102-
- hugeParam
103-
gocyclo:
104-
min-complexity: 15
105-
govet:
106-
enable-all: true
107-
disable:
108-
- fieldalignment
109-
settings:
110-
printf: # analyzer name, run `go tool vet help` to see all analyzers
111-
funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
112-
- debug,debugf,debugln
113-
- error,errorf,errorln
114-
- fatal,fatalf,fataln
115-
- info,infof,infoln
116-
- log,logf,logln
117-
- warn,warnf,warnln
118-
- print,printf,println,sprint,sprintf,sprintln,fprint,fprintf,fprintln
119-
misspell:
120-
locale: US
47+
- wsl
48+
settings:
49+
goconst:
50+
min-len: 2
51+
min-occurrences: 2
52+
gocritic:
53+
disabled-checks:
54+
- dupImport
55+
- ifElseChain
56+
- whyNoLint
57+
- sloppyReassign
58+
- uncheckedInlineErr
59+
- hugeParam
60+
enabled-tags:
61+
- diagnostic
62+
- experimental
63+
- opinionated
64+
- performance
65+
- style
66+
gocyclo:
67+
min-complexity: 15
68+
govet:
69+
disable:
70+
- fieldalignment
71+
enable-all: true
72+
settings:
73+
printf:
74+
funcs:
75+
- debug,debugf,debugln
76+
- error,errorf,errorln
77+
- fatal,fatalf,fataln
78+
- info,infof,infoln
79+
- log,logf,logln
80+
- warn,warnf,warnln
81+
- print,printf,println,sprint,sprintf,sprintln,fprint,fprintf,fprintln
82+
misspell:
83+
locale: US
84+
exclusions:
85+
generated: lax
86+
presets:
87+
- comments
88+
- common-false-positives
89+
- legacy
90+
- std-error-handling
91+
paths:
92+
- third_party$
93+
- builtin$
94+
- examples$
95+
formatters:
96+
enable:
97+
- gofmt
98+
- goimports
99+
exclusions:
100+
generated: lax
101+
paths:
102+
- third_party$
103+
- builtin$
104+
- examples$

.goreleaser.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
project_name: apm-lambda-extension
22

3+
version: 2
4+
35
before:
46
hooks:
57
- make check-licenses
@@ -22,7 +24,7 @@ builds:
2224

2325
archives:
2426
- id: zip
25-
format: zip
27+
formats: zip
2628
name_template: |-
2729
{{ .Tag }}-{{ .Os }}-{{ .Arch }}
2830
files:

Makefile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
SHELL = /bin/bash -eo pipefail
22

3-
GORELEASER_VERSION = "v1.19.2"
4-
GO_LICENSER_VERSION = "v0.4.0"
5-
GOLANGCI_LINT_VERSION = "v1.64.4"
63
export DOCKER_IMAGE_NAME = observability/apm-lambda-extension
74
export DOCKER_REGISTRY = docker.elastic.co
85

@@ -12,44 +9,44 @@ clean:
129

1310
.PHONY: dist
1411
dist:
15-
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --snapshot --clean
12+
@go tool github.com/goreleaser/goreleaser/v2 release --snapshot --clean
1613

1714
.PHONY: zip
1815
zip:
19-
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --snapshot --clean --skip-docker
16+
@go tool github.com/goreleaser/goreleaser/v2 release --snapshot --clean --skip docker
2017

2118
build:
22-
@go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) build --snapshot --clean
19+
@go tool github.com/goreleaser/goreleaser/v2 build --snapshot --clean
2320

2421
.PHONY: release
2522
release:
26-
go run github.com/goreleaser/goreleaser@$(GORELEASER_VERSION) release --clean
23+
go tool github.com/goreleaser/goreleaser/v2 release --clean
2724

2825
.PHONY: release-notes
2926
release-notes:
3027
@./.ci/release-github.sh
3128

3229
.PHONY: test
3330
test:
34-
@go run gotest.tools/gotestsum@v1.9.0 --format testname --junitfile $(junitfile)
31+
@go tool gotest.tools/gotestsum --format testname --junitfile $(junitfile)
3532

3633
.PHONY: lint-prep
3734
lint-prep:
3835
@go mod tidy && git diff --exit-code
3936

4037
.PHONY: lint
4138
lint:
42-
@if [ "$(CI)" != "" ]; then go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) version; fi
43-
@go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --build-tags tools
39+
@if [ "$(CI)" != "" ]; then go tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint version; fi
40+
@go tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint run
4441

4542
NOTICE.txt: go.mod
4643
@bash ./scripts/notice.sh
4744

4845
.PHONY: check-licenses
4946
check-licenses:
50-
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing -exclude e2e-testing .
51-
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing -exclude e2e-testing -ext .java .
52-
@go run github.com/elastic/go-licenser@$(GO_LICENSER_VERSION) -d -exclude tf -exclude testing -exclude e2e-testing -ext .js .
47+
@go tool github.com/elastic/go-licenser -d -exclude tf -exclude testing -exclude e2e-testing .
48+
@go tool github.com/elastic/go-licenser -d -exclude tf -exclude testing -exclude e2e-testing -ext .java .
49+
@go tool github.com/elastic/go-licenser -d -exclude tf -exclude testing -exclude e2e-testing -ext .js .
5350

5451

5552
.PHONY: check-notice

NOTICE.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,11 +3570,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
35703570

35713571
--------------------------------------------------------------------------------
35723572
Module : go.uber.org/multierr
3573-
Version : v1.10.0
3574-
Time : 2023-03-08T14:40:37Z
3573+
Version : v1.11.0
3574+
Time : 2023-03-29T23:00:37Z
35753575
Licence : MIT
35763576

3577-
Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.10.0/LICENSE.txt:
3577+
Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.11.0/LICENSE.txt:
35783578

35793579
Copyright (c) 2017-2021 Uber Technologies, Inc.
35803580

0 commit comments

Comments
 (0)