Skip to content

Bump go + fasthttp + lint #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ jobs:
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v1
with:
go-version: 1.13

- name: Install Golint
run: go install golang.org/x/lint/golint

- name: Lint
run: golint
go-version: '1.17'

- name: golangci-lint
uses: golangci/golangci-lint-action@v2

unit-test:
runs-on: ubuntu-latest
Expand All @@ -31,7 +28,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.13
go-version: '1.17'

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

- name: Cache Node modules
id: cache-node-modules
Expand Down
6 changes: 3 additions & 3 deletions ddlambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type (
DDTraceEnabled bool
// MergeXrayTraces will cause Datadog traces to be merged with traces from AWS X-Ray.
MergeXrayTraces bool
// HttpClientTimeout specifies a time limit for requests to the API. It defaults to 5s.
HttpClientTimeout time.Duration
// HTTPClientTimeout specifies a time limit for requests to the API. It defaults to 5s.
HTTPClientTimeout time.Duration
// CircuitBreakerInterval is the cyclic period of the closed state
// for the CircuitBreaker to clear the internal Counts.
// default: 30s
Expand Down Expand Up @@ -237,7 +237,7 @@ func (cfg *Config) toMetricsConfig(isExtensionRunning bool) metrics.Config {
mc.KMSAPIKey = cfg.KMSAPIKey
mc.Site = cfg.Site
mc.ShouldUseLogForwarder = cfg.ShouldUseLogForwarder
mc.HttpClientTimeout = cfg.HttpClientTimeout
mc.HTTPClientTimeout = cfg.HTTPClientTimeout
}

if mc.Site == "" {
Expand Down
6 changes: 4 additions & 2 deletions ddlambda_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ import (

func TestInvokeDryRun(t *testing.T) {
called := false
InvokeDryRun(func(ctx context.Context) {
_, err := InvokeDryRun(func(ctx context.Context) {
called = true
globalCtx := GetContext()
assert.Equal(t, globalCtx, ctx)
}, nil)
assert.NoError(t, err)
assert.True(t, called)
}

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

InvokeDryRun(func(ctx context.Context) {
_, err := InvokeDryRun(func(ctx context.Context) {
Metric("my-metric", 100, "my:tag")
}, &Config{
APIKey: "abc-123",
Site: server.URL,
})
assert.NoError(t, err)
assert.True(t, called)
}
51 changes: 39 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
module github.com/DataDog/datadog-lambda-go

go 1.13
go 1.17

require (
github.com/DATA-DOG/go-sqlmock v1.5.0 // indirect
github.com/DataDog/datadog-go v4.4.0+incompatible
github.com/Microsoft/go-winio v0.4.19 // indirect
github.com/aws/aws-lambda-go v1.25.0
github.com/aws/aws-sdk-go v1.40.2
github.com/DataDog/datadog-go v4.8.3+incompatible
github.com/aws/aws-lambda-go v1.29.0
github.com/aws/aws-sdk-go v1.43.37
github.com/aws/aws-xray-sdk-go v1.6.0
github.com/cenkalti/backoff v2.1.1+incompatible
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/sony/gobreaker v0.4.1
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/sony/gobreaker v0.5.0
github.com/stretchr/testify v1.7.0
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.37.1
)

require (
github.com/DATA-DOG/go-sqlmock v1.5.0 // indirect
github.com/DataDog/datadog-agent/pkg/obfuscate v0.35.0 // indirect
github.com/DataDog/datadog-go/v5 v5.1.0 // indirect
github.com/DataDog/sketches-go v1.4.1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.15.1 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.35.0 // indirect
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 // indirect
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.30.0
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac // indirect
google.golang.org/grpc v1.45.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading