Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b0ce889

Browse files
maxdaypeterdeme
authored andcommitted
Bump go + fasthttp + lint (DataDog#104)
1 parent 70b369e commit b0ce889

File tree

23 files changed

+1389
-134
lines changed

23 files changed

+1389
-134
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ jobs:
1111
uses: actions/checkout@v2
1212

1313
- name: Set up Go
14-
uses: actions/setup-go@v2
14+
uses: actions/setup-go@v1
1515
with:
16-
go-version: 1.13
17-
18-
- name: Install Golint
19-
run: go install golang.org/x/lint/golint
20-
21-
- name: Lint
22-
run: golint
16+
go-version: '1.17'
17+
18+
- name: golangci-lint
19+
uses: golangci/golangci-lint-action@v2
2320

2421
unit-test:
2522
runs-on: ubuntu-latest
@@ -31,7 +28,7 @@ jobs:
3128
- name: Set up Go
3229
uses: actions/setup-go@v1
3330
with:
34-
go-version: 1.13
31+
go-version: '1.17'
3532

3633
- name: Run tests
3734
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
@@ -54,7 +51,7 @@ jobs:
5451
- name: Set up Go
5552
uses: actions/setup-go@v1
5653
with:
57-
go-version: 1.13
54+
go-version: '1.17'
5855

5956
- name: Cache Node modules
6057
id: cache-node-modules

ddlambda.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ type (
5555
DDTraceEnabled bool
5656
// MergeXrayTraces will cause Datadog traces to be merged with traces from AWS X-Ray.
5757
MergeXrayTraces bool
58-
// HttpClientTimeout specifies a time limit for requests to the API. It defaults to 5s.
59-
HttpClientTimeout time.Duration
58+
// HTTPClientTimeout specifies a time limit for requests to the API. It defaults to 5s.
59+
HTTPClientTimeout time.Duration
6060
// CircuitBreakerInterval is the cyclic period of the closed state
6161
// for the CircuitBreaker to clear the internal Counts.
6262
// default: 30s
@@ -242,7 +242,7 @@ func (cfg *Config) toMetricsConfig(isExtensionRunning bool) metrics.Config {
242242
mc.KMSAPIKey = cfg.KMSAPIKey
243243
mc.Site = cfg.Site
244244
mc.ShouldUseLogForwarder = cfg.ShouldUseLogForwarder
245-
mc.HttpClientTimeout = cfg.HttpClientTimeout
245+
mc.HTTPClientTimeout = cfg.HTTPClientTimeout
246246
}
247247

248248
if mc.Site == "" {

ddlambda_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ import (
1818

1919
func TestInvokeDryRun(t *testing.T) {
2020
called := false
21-
InvokeDryRun(func(ctx context.Context) {
21+
_, err := InvokeDryRun(func(ctx context.Context) {
2222
called = true
2323
globalCtx := GetContext()
2424
assert.Equal(t, globalCtx, ctx)
2525
}, nil)
26+
assert.NoError(t, err)
2627
assert.True(t, called)
2728
}
2829

@@ -38,11 +39,12 @@ func TestMetricsSubmitWithWrapper(t *testing.T) {
3839
}))
3940
defer server.Close()
4041

41-
InvokeDryRun(func(ctx context.Context) {
42+
_, err := InvokeDryRun(func(ctx context.Context) {
4243
Metric("my-metric", 100, "my:tag")
4344
}, &Config{
4445
APIKey: "abc-123",
4546
Site: server.URL,
4647
})
48+
assert.NoError(t, err)
4749
assert.True(t, called)
4850
}

go.mod

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
module github.com/DataDog/datadog-lambda-go
22

3-
go 1.13
3+
go 1.17
44

55
require (
6-
github.com/DATA-DOG/go-sqlmock v1.5.0 // indirect
7-
github.com/DataDog/datadog-go v4.4.0+incompatible
8-
github.com/Microsoft/go-winio v0.4.19 // indirect
9-
github.com/aws/aws-lambda-go v1.25.0
10-
github.com/aws/aws-sdk-go v1.40.2
6+
github.com/DataDog/datadog-go v4.8.3+incompatible
7+
github.com/aws/aws-lambda-go v1.29.0
8+
github.com/aws/aws-sdk-go v1.43.37
119
github.com/aws/aws-xray-sdk-go v1.6.0
12-
github.com/cenkalti/backoff v2.1.1+incompatible
13-
github.com/opentracing/opentracing-go v1.2.0 // indirect
14-
github.com/philhofer/fwd v1.0.0 // indirect
15-
github.com/sony/gobreaker v0.4.1
10+
github.com/cenkalti/backoff v2.2.1+incompatible
11+
github.com/sony/gobreaker v0.5.0
1612
github.com/stretchr/testify v1.7.0
17-
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
13+
gopkg.in/DataDog/dd-trace-go.v1 v1.37.1
14+
)
15+
16+
require (
17+
github.com/DATA-DOG/go-sqlmock v1.5.0 // indirect
18+
github.com/DataDog/datadog-agent/pkg/obfuscate v0.35.0 // indirect
19+
github.com/DataDog/datadog-go/v5 v5.1.0 // indirect
20+
github.com/DataDog/sketches-go v1.4.1 // indirect
21+
github.com/Microsoft/go-winio v0.5.2 // indirect
22+
github.com/andybalholm/brotli v1.0.4 // indirect
23+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
24+
github.com/davecgh/go-spew v1.1.1 // indirect
25+
github.com/dgraph-io/ristretto v0.1.0 // indirect
26+
github.com/dustin/go-humanize v1.0.0 // indirect
27+
github.com/golang/glog v1.0.0 // indirect
28+
github.com/golang/protobuf v1.5.2 // indirect
29+
github.com/google/uuid v1.3.0 // indirect
30+
github.com/jmespath/go-jmespath v0.4.0 // indirect
31+
github.com/klauspost/compress v1.15.1 // indirect
32+
github.com/philhofer/fwd v1.1.1 // indirect
33+
github.com/pkg/errors v0.9.1 // indirect
34+
github.com/pmezard/go-difflib v1.0.0 // indirect
35+
github.com/tinylib/msgp v1.1.6 // indirect
36+
github.com/valyala/bytebufferpool v1.0.0 // indirect
37+
github.com/valyala/fasthttp v1.35.0 // indirect
38+
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 // indirect
39+
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f // indirect
40+
golang.org/x/text v0.3.7 // indirect
41+
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
1842
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
19-
gopkg.in/DataDog/dd-trace-go.v1 v1.30.0
43+
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
44+
google.golang.org/grpc v1.45.0 // indirect
45+
google.golang.org/protobuf v1.28.0 // indirect
46+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
2047
)

0 commit comments

Comments
 (0)