From d86a699e82fc297997867f074367f14311d7c4f0 Mon Sep 17 00:00:00 2001 From: Carlos Roman Date: Tue, 28 Jun 2022 11:30:09 +0100 Subject: [PATCH] Dropping support for go 1.12 - 1.15 --- .github/workflows/generate.yaml | 7 +++++-- go.mod | 2 +- go.sum | 3 --- statsd/benchmark_report_metric_noop_test.go | 7 ------- statsd/benchmark_report_metric_test.go | 9 --------- statsd/end_to_end_uds_test.go | 1 + statsd/pipe.go | 1 + statsd/pipe_windows.go | 1 + statsd/pipe_windows_test.go | 1 + statsd/statsd_benchmark_test.go | 4 ++-- statsd/uds.go | 1 + statsd/uds_test.go | 1 + statsd/uds_windows.go | 1 + 13 files changed, 15 insertions(+), 24 deletions(-) delete mode 100644 statsd/benchmark_report_metric_noop_test.go delete mode 100644 statsd/benchmark_report_metric_test.go diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index a5977228e..1801efae1 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -1,3 +1,4 @@ +--- name: generate-mock on: pull_request: @@ -6,7 +7,9 @@ jobs: native: strategy: matrix: - runs-on: [ ubuntu-latest, windows-latest] + runs-on: + - ubuntu-latest + - windows-latest fail-fast: false runs-on: ${{ matrix.runs-on }} steps: @@ -16,6 +19,6 @@ jobs: go-version: 1.16 - name: Checkout code uses: actions/checkout@v2 - - run: go install github.com/golang/mock/mockgen + - run: go install github.com/golang/mock/mockgen@v1.6.0 - run: go generate statsd/statsd.go - run: git diff --exit-code HEAD diff --git a/go.mod b/go.mod index 3f8a52883..7ee16e727 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/DataDog/datadog-go/v5 -go 1.13 +go 1.16 require ( github.com/Microsoft/go-winio v0.5.0 diff --git a/go.sum b/go.sum index a9d41d18b..6a844d057 100644 --- a/go.sum +++ b/go.sum @@ -17,7 +17,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -37,11 +36,9 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/statsd/benchmark_report_metric_noop_test.go b/statsd/benchmark_report_metric_noop_test.go deleted file mode 100644 index 8e1cabd87..000000000 --- a/statsd/benchmark_report_metric_noop_test.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !go1.13 - -package statsd_test - -import "testing" - -func reportMetric(*testing.B, float64, string) {} diff --git a/statsd/benchmark_report_metric_test.go b/statsd/benchmark_report_metric_test.go deleted file mode 100644 index dcf0f522a..000000000 --- a/statsd/benchmark_report_metric_test.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.13 - -package statsd_test - -import "testing" - -func reportMetric(b *testing.B, value float64, unit string) { - b.ReportMetric(value, unit) -} diff --git a/statsd/end_to_end_uds_test.go b/statsd/end_to_end_uds_test.go index be4f4b9a3..7f15f1a37 100644 --- a/statsd/end_to_end_uds_test.go +++ b/statsd/end_to_end_uds_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package statsd diff --git a/statsd/pipe.go b/statsd/pipe.go index 84c38e966..426359c5f 100644 --- a/statsd/pipe.go +++ b/statsd/pipe.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package statsd diff --git a/statsd/pipe_windows.go b/statsd/pipe_windows.go index 5ab60f00c..2ca85f70f 100644 --- a/statsd/pipe_windows.go +++ b/statsd/pipe_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package statsd diff --git a/statsd/pipe_windows_test.go b/statsd/pipe_windows_test.go index 1efbf2b8d..0a3279e70 100644 --- a/statsd/pipe_windows_test.go +++ b/statsd/pipe_windows_test.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package statsd diff --git a/statsd/statsd_benchmark_test.go b/statsd/statsd_benchmark_test.go index b3143bac7..b4cd45321 100644 --- a/statsd/statsd_benchmark_test.go +++ b/statsd/statsd_benchmark_test.go @@ -82,7 +82,7 @@ func benchmarkStatsdDifferentMetrics(b *testing.B, transport string, extraOption }) client.Flush() t := client.GetTelemetry() - reportMetric(b, float64(t.TotalDroppedOnReceive)/float64(t.TotalMetrics)*100, "%_dropRate") + b.ReportMetric(float64(t.TotalDroppedOnReceive)/float64(t.TotalMetrics)*100, "%_dropRate") b.StopTimer() client.Close() @@ -101,7 +101,7 @@ func benchmarkStatsdSameMetrics(b *testing.B, transport string, extraOptions ... }) client.Flush() t := client.GetTelemetry() - reportMetric(b, float64(t.TotalDroppedOnReceive)/float64(t.TotalMetrics)*100, "%_dropRate") + b.ReportMetric(float64(t.TotalDroppedOnReceive)/float64(t.TotalMetrics)*100, "%_dropRate") b.StopTimer() client.Close() diff --git a/statsd/uds.go b/statsd/uds.go index fa5f5917f..510a7603b 100644 --- a/statsd/uds.go +++ b/statsd/uds.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package statsd diff --git a/statsd/uds_test.go b/statsd/uds_test.go index fb1c0c829..939b3e2c1 100644 --- a/statsd/uds_test.go +++ b/statsd/uds_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package statsd diff --git a/statsd/uds_windows.go b/statsd/uds_windows.go index 077894a33..bd358aefc 100644 --- a/statsd/uds_windows.go +++ b/statsd/uds_windows.go @@ -1,3 +1,4 @@ +//go:build windows // +build windows package statsd