Skip to content

Commit c19d16b

Browse files
authored
upgrade go to 1.23 and golangci-lint to 1.64 (#612)
1 parent 2670764 commit c19d16b

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

.golangci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ linters:
3131
# - too many non-sensical warnings
3232
# - not relevant for us
3333
# - false positives
34-
#
34+
#
3535
# "might be worth fixing" means we should investigate/fix in the mid term
3636
- canonicalheader
3737
- contextcheck # might be worth fixing
@@ -54,7 +54,6 @@ linters:
5454
- godot
5555
- godox # complains about TODO etc
5656
- gofumpt
57-
- gomnd
5857
- gomoddirectives
5958
- inamedparam
6059
- interfacebloat
@@ -77,8 +76,6 @@ linters:
7776
- wastedassign
7877
- wsl
7978
- wrapcheck
80-
# the following linters are deprecated
81-
- execinquery
8279
# we don't want to change code to Go 1.22+ yet
8380
- intrange
8481
- copyloopvar

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ SHELL = /bin/bash -eo pipefail
22

33
GORELEASER_VERSION = "v1.19.2"
44
GO_LICENSER_VERSION = "v0.4.0"
5-
GOLANGCI_LINT_VERSION = "v1.59.1"
5+
GOLANGCI_LINT_VERSION = "v1.64.4"
66
export DOCKER_IMAGE_NAME = observability/apm-lambda-extension
77
export DOCKER_REGISTRY = docker.elastic.co
88

e2e-testing/e2e_test.go

+11-7
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ import (
3939
"go.uber.org/zap"
4040
)
4141

42-
var rebuildPtr = flag.Bool("rebuild", false, "rebuild lambda functions")
43-
var langPtr = flag.String("lang", "nodejs", "the language of the Lambda test function : Java, Node, or Python")
44-
var timerPtr = flag.Int("timer", 20, "the timeout of the test lambda function")
45-
var javaAgentVerPtr = flag.String("java-agent-ver", "1.28.4", "the version of the java APM agent")
42+
var (
43+
rebuildPtr = flag.Bool("rebuild", false, "rebuild lambda functions")
44+
langPtr = flag.String("lang", "nodejs", "the language of the Lambda test function : Java, Node, or Python")
45+
timerPtr = flag.Int("timer", 20, "the timeout of the test lambda function")
46+
javaAgentVerPtr = flag.String("java-agent-ver", "1.28.4", "the version of the java APM agent")
47+
)
4648

4749
func TestEndToEnd(t *testing.T) {
4850
// Check the only mandatory environment variable
@@ -103,7 +105,7 @@ func TestEndToEnd(t *testing.T) {
103105
t.Fail()
104106
}
105107
l.Infof("Querying the mock server for transaction bound to %s...", samServiceName)
106-
assert.True(t, strings.Contains(mockAPMServerLog, testUUID))
108+
assert.Contains(t, mockAPMServerLog, testUUID)
107109
}
108110

109111
func runTestWithTimer(l *zap.SugaredLogger, path, serviceName, serverURL string, buildFlag bool, lambdaFuncTimeout int, resultsChan chan string) string {
@@ -134,10 +136,12 @@ func runTest(l *zap.SugaredLogger, path, serviceName, serverURL string, buildFla
134136
uuidWithHyphen := uuid.New().String()
135137
urlSlice := strings.Split(serverURL, ":")
136138
port := urlSlice[len(urlSlice)-1]
137-
RunCommandInDir(l, "sam", []string{"local", "invoke", "--parameter-overrides",
139+
RunCommandInDir(l, "sam", []string{
140+
"local", "invoke", "--parameter-overrides",
138141
"ParameterKey=ApmServerURL,ParameterValue=http://host.docker.internal:" + port,
139142
"ParameterKey=TestUUID,ParameterValue=" + uuidWithHyphen,
140-
"ParameterKey=TimeoutParam,ParameterValue=" + strconv.Itoa(lambdaFuncTimeout)},
143+
"ParameterKey=TimeoutParam,ParameterValue=" + strconv.Itoa(lambdaFuncTimeout),
144+
},
141145
path)
142146
l.Infof("%s execution complete", serviceName)
143147

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/elastic/apm-aws-lambda
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
github.com/aws/aws-sdk-go-v2 v1.36.1

logsapi/model/model_json.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main_test.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"net/http"
2727
"net/http/httptest"
2828
"os"
29-
"regexp"
3029
"strconv"
3130
"strings"
3231
"sync"
@@ -439,7 +438,7 @@ func startLogSender(ctx context.Context, q <-chan logsapi.LogEvent, logsapiAddr
439438
return err
440439
}
441440
defer resp.Body.Close()
442-
if resp.StatusCode/100 != 2 { //nolint:usestdlibvars
441+
if resp.StatusCode/100 != 2 {
443442
return fmt.Errorf("received a non 2xx status code: %d", resp.StatusCode)
444443
}
445444
return nil
@@ -569,8 +568,7 @@ func TestLateFlush(t *testing.T) {
569568
case <-runApp(t, logsapiAddr):
570569
assert.Regexp(
571570
t,
572-
regexp.MustCompile(fmt.Sprintf(".*\n%s.*\n%s", TimelyResponse,
573-
TimelyResponse)), // metadata followed by TimelyResponsex2
571+
fmt.Sprintf(".*\n%s.*\n%s", TimelyResponse, TimelyResponse), // metadata followed by TimelyResponsex2
574572
apmServerInternals.Data,
575573
)
576574
case <-time.After(timeout):

0 commit comments

Comments
 (0)