From 2116719e97eb232a692364b51454620712823a89 Mon Sep 17 00:00:00 2001 From: Eyal Maderer <87379249+emaderer@users.noreply.github.com> Date: Wed, 25 Aug 2021 13:49:09 -0700 Subject: [PATCH] Upgrade to Go 1.17 (#3887) --- .circleci/config.yml | 8 +- .github/workflows/api-compatibility.yml | 2 +- .github/workflows/build-and-test.yml | 14 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/contrib-tests.yml | 2 +- .github/workflows/dependabot.yml | 2 +- CONTRIBUTING.md | 9 +- cmd/checkdoc/go.mod | 8 +- cmd/issuegenerator/go.mod | 11 +- cmd/mdatagen/go.mod | 12 +- cmd/otelcol/main_others.go | 1 + cmd/otelcol/main_windows.go | 1 + examples/demo/client/Dockerfile | 2 +- examples/demo/client/go.mod | 17 +- examples/demo/server/Dockerfile | 2 +- examples/demo/server/go.mod | 16 +- exporter/loggingexporter/known_sync_error.go | 1 + .../known_sync_error_windows.go | 1 + go.mod | 37 ++++- go.sum | 4 - internal/cgroups/cgroup.go | 1 + internal/cgroups/cgroup_test.go | 1 + internal/cgroups/cgroups.go | 1 + internal/cgroups/cgroups_test.go | 1 + internal/cgroups/errors.go | 1 + internal/cgroups/mountpoint.go | 1 + internal/cgroups/mountpoint_test.go | 1 + internal/cgroups/subsys.go | 1 + internal/cgroups/subsys_test.go | 1 + internal/cgroups/util_test.go | 1 + internal/iruntime/total_memory_linux.go | 1 + internal/iruntime/total_memory_linux_test.go | 1 + internal/iruntime/total_memory_other.go | 1 + internal/iruntime/total_memory_other_test.go | 1 + internal/tools/go.mod | 157 +++++++++++++++++- internal/tools/tools.go | 1 + model/go.mod | 8 +- service/collector_windows.go | 1 + service/collector_windows_test.go | 1 + 39 files changed, 295 insertions(+), 39 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d04c21168b..17e59ee762 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,7 +29,7 @@ orbs: executors: golang: docker: - - image: cimg/go:1.16 + - image: cimg/go:1.17 commands: verify_dist_files_exist: @@ -220,7 +220,7 @@ jobs: publish-check: docker: - - image: cimg/go:1.16 + - image: cimg/go:1.17 steps: - attach_to_workspace - setup_remote_docker @@ -236,7 +236,7 @@ jobs: publish-stable: docker: - - image: cimg/go:1.16 + - image: cimg/go:1.17 steps: - attach_to_workspace - verify_dist_files_exist @@ -257,7 +257,7 @@ jobs: publish-dev: docker: - - image: cimg/go:1.16 + - image: cimg/go:1.17 steps: - attach_to_workspace - verify_dist_files_exist diff --git a/.github/workflows/api-compatibility.yml b/.github/workflows/api-compatibility.yml index 04bfbbd33a..cf8eff8a85 100644 --- a/.github/workflows/api-compatibility.yml +++ b/.github/workflows/api-compatibility.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Install-Tools run: | diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 068a6acf09..dcab274026 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -46,7 +46,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -86,7 +86,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -128,7 +128,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -172,7 +172,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -206,7 +206,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV @@ -266,7 +266,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 - name: Setup Go Environment run: | echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d91c04f3e6..2b05d1b628 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2.1.3 with: - go-version: 1.16 + go-version: 1.17 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index 5e6b3123bb..2473041bd1 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -10,7 +10,7 @@ jobs: contrib_tests: runs-on: ubuntu-latest container: - image: cimg/go:1.16 + image: cimg/go:1.17 steps: - name: Setup Permissions run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index 2f9db53b37..8460dc731f 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -14,7 +14,7 @@ jobs: ref: ${{ github.head_ref }} - uses: actions/setup-go@v2 with: - go-version: '^1.16.0' + go-version: '^1.17.0' - uses: evantorrie/mott-the-tidier@v1-beta id: modtidy with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31bc625eb0..d280771364 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,7 @@ section of general project contributing guide. Working with the project sources requires the following tools: 1. [git](https://git-scm.com/) -2. [go](https://golang.org/) (version 1.16 and up) +2. [go](https://golang.org/) (version 1.17 and up) 3. [make](https://www.gnu.org/software/make/) 4. [docker](https://www.docker.com/) @@ -152,7 +152,7 @@ $ git push fork feature ## General Notes -This project uses Go 1.16.* and CircleCI. +This project uses Go 1.17.* and CircleCI. CircleCI uses the Makefile with the `ci` target, it is recommended to run it before submitting your PR. It runs `gofmt -s` (simplify) and `golint`. @@ -289,11 +289,6 @@ do not decrease overall code coverage of the codebase - this is aligned with our goal to increase coverage over time. Keep track of execution time for your unit tests and try to keep them as short as possible. -## End-to-end Tests - -If you implement a new component add end-to-end tests for the component using -the automated [Testbed](testbed/README.md). - ## Release See [release](docs/release.md) for details. diff --git a/cmd/checkdoc/go.mod b/cmd/checkdoc/go.mod index e2061cd957..c01bdc12bf 100644 --- a/cmd/checkdoc/go.mod +++ b/cmd/checkdoc/go.mod @@ -1,5 +1,11 @@ module go.opentelemetry.io/collector/cmd/checkdoc -go 1.16 +go 1.17 require github.com/stretchr/testify v1.7.0 + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/cmd/issuegenerator/go.mod b/cmd/issuegenerator/go.mod index 5b53c1d4ea..e78f4f6019 100644 --- a/cmd/issuegenerator/go.mod +++ b/cmd/issuegenerator/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/cmd/issuegenerator -go 1.16 +go 1.17 require ( github.com/google/go-github v17.0.0+incompatible @@ -9,3 +9,12 @@ require ( go.uber.org/zap v1.19.0 golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 ) + +require ( + github.com/golang/protobuf v1.4.2 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect +) diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index f2673f02b7..cb03295d7e 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/cmd/mdatagen -go 1.16 +go 1.17 require ( github.com/go-playground/locales v0.14.0 @@ -9,3 +9,13 @@ require ( github.com/stretchr/testify v1.7.0 gopkg.in/yaml.v2 v2.4.0 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect + golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect + golang.org/x/text v0.3.6 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) diff --git a/cmd/otelcol/main_others.go b/cmd/otelcol/main_others.go index 9c40f95931..5f7a442d9a 100644 --- a/cmd/otelcol/main_others.go +++ b/cmd/otelcol/main_others.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package main diff --git a/cmd/otelcol/main_windows.go b/cmd/otelcol/main_windows.go index db4106bdbb..fa88a4d8c4 100644 --- a/cmd/otelcol/main_windows.go +++ b/cmd/otelcol/main_windows.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package main diff --git a/examples/demo/client/Dockerfile b/examples/demo/client/Dockerfile index f4de9763f0..4ffbb23c4d 100644 --- a/examples/demo/client/Dockerfile +++ b/examples/demo/client/Dockerfile @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.16 +FROM golang:1.17 COPY . /usr/src/client/ WORKDIR /usr/src/client/ RUN go env -w GOPROXY=direct diff --git a/examples/demo/client/go.mod b/examples/demo/client/go.mod index 54e2baaf0a..487fa0cb6e 100644 --- a/examples/demo/client/go.mod +++ b/examples/demo/client/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/examples/demo/client -go 1.16 +go 1.17 require ( github.com/davecgh/go-spew v1.1.1 // indirect @@ -17,3 +17,18 @@ require ( google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect google.golang.org/grpc v1.39.0 ) + +require ( + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + go.opentelemetry.io/contrib v0.21.0 // indirect + go.opentelemetry.io/otel/internal/metric v0.22.0 // indirect + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 // indirect + go.opentelemetry.io/otel/trace v1.0.0-RC1 // indirect + go.opentelemetry.io/proto/otlp v0.9.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + golang.org/x/text v0.3.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect +) diff --git a/examples/demo/server/Dockerfile b/examples/demo/server/Dockerfile index f348a20923..050f9fcf7f 100644 --- a/examples/demo/server/Dockerfile +++ b/examples/demo/server/Dockerfile @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.16 +FROM golang:1.17 COPY . /usr/src/server/ WORKDIR /usr/src/server/ RUN go env -w GOPROXY=direct diff --git a/examples/demo/server/go.mod b/examples/demo/server/go.mod index 6021532749..8c4b3329ae 100644 --- a/examples/demo/server/go.mod +++ b/examples/demo/server/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/examples/demo/server -go 1.16 +go 1.17 require ( github.com/davecgh/go-spew v1.1.1 // indirect @@ -18,3 +18,17 @@ require ( google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece // indirect google.golang.org/grpc v1.39.0 ) + +require ( + github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + go.opentelemetry.io/contrib v0.21.0 // indirect + go.opentelemetry.io/otel/internal/metric v0.22.0 // indirect + go.opentelemetry.io/otel/sdk/export/metric v0.22.0 // indirect + go.opentelemetry.io/proto/otlp v0.9.0 // indirect + golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect + golang.org/x/text v0.3.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect +) diff --git a/exporter/loggingexporter/known_sync_error.go b/exporter/loggingexporter/known_sync_error.go index 9118d5e31f..cad34d12b3 100644 --- a/exporter/loggingexporter/known_sync_error.go +++ b/exporter/loggingexporter/known_sync_error.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package loggingexporter diff --git a/exporter/loggingexporter/known_sync_error_windows.go b/exporter/loggingexporter/known_sync_error_windows.go index ef26294c03..e2d38a098b 100644 --- a/exporter/loggingexporter/known_sync_error_windows.go +++ b/exporter/loggingexporter/known_sync_error_windows.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package loggingexporter diff --git a/go.mod b/go.mod index 3c44580702..4328725e1f 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,19 @@ module go.opentelemetry.io/collector -go 1.16 +go 1.17 require ( cloud.google.com/go v0.83.0 // indirect contrib.go.opencensus.io/exporter/prometheus v0.3.0 github.com/StackExchange/wmi v1.2.1 // indirect - github.com/antonmedv/expr v1.9.0 github.com/cenkalti/backoff/v4 v4.1.1 github.com/census-instrumentation/opencensus-proto v0.3.0 github.com/fatih/structtag v1.2.0 github.com/gogo/protobuf v1.3.2 - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 github.com/jaegertracing/jaeger v1.25.0 github.com/knadh/koanf v1.2.1 - github.com/leoluk/perflib_exporter v0.1.0 github.com/magiconair/properties v1.8.5 github.com/mitchellh/mapstructure v1.4.1 github.com/prometheus/common v0.30.0 @@ -47,6 +44,38 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/go-kit/log v0.1.0 // indirect + github.com/go-logfmt/logfmt v0.5.0 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/numcpus v0.2.2 // indirect + github.com/uber/jaeger-lib v2.4.1+incompatible // indirect + go.opentelemetry.io/contrib v0.22.0 // indirect + go.opentelemetry.io/otel/internal/metric v0.22.0 // indirect + go.opentelemetry.io/otel/metric v0.22.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) + replace go.opentelemetry.io/collector/model => ./model retract v0.32.0 // Contains incomplete metrics transition to proto 0.9.0, random components are not working. diff --git a/go.sum b/go.sum index d54bc5499d..f5edc7efa6 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,6 @@ github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15/go.mod h1:OMCwj8V github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antonmedv/expr v1.8.9/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= -github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= -github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -638,7 +636,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leoluk/perflib_exporter v0.1.0 h1:fXe/mDaf9jR+Zk8FjFlcCSksACuIj2VNN4GyKHmQqtA= github.com/leoluk/perflib_exporter v0.1.0/go.mod h1:rpV0lYj7lemdTm31t7zpCqYqPnw7xs86f+BaaNBVYFM= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -926,7 +923,6 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3 github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= diff --git a/internal/cgroups/cgroup.go b/internal/cgroups/cgroup.go index c754fb82a3..2e2702a9bd 100644 --- a/internal/cgroups/cgroup.go +++ b/internal/cgroups/cgroup.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/cgroup_test.go b/internal/cgroups/cgroup_test.go index 209d56b3bc..968ac863a8 100644 --- a/internal/cgroups/cgroup_test.go +++ b/internal/cgroups/cgroup_test.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/cgroups.go b/internal/cgroups/cgroups.go index f51cb2f2c4..8eb3c18345 100644 --- a/internal/cgroups/cgroups.go +++ b/internal/cgroups/cgroups.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/cgroups_test.go b/internal/cgroups/cgroups_test.go index 0dbfc69626..5d16ba651a 100644 --- a/internal/cgroups/cgroups_test.go +++ b/internal/cgroups/cgroups_test.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/errors.go b/internal/cgroups/errors.go index 8bb10808a3..c28bbab53d 100644 --- a/internal/cgroups/errors.go +++ b/internal/cgroups/errors.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/mountpoint.go b/internal/cgroups/mountpoint.go index aacbdace07..ce952352cc 100644 --- a/internal/cgroups/mountpoint.go +++ b/internal/cgroups/mountpoint.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/mountpoint_test.go b/internal/cgroups/mountpoint_test.go index 7364deff0b..1c36d9fbe8 100644 --- a/internal/cgroups/mountpoint_test.go +++ b/internal/cgroups/mountpoint_test.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/subsys.go b/internal/cgroups/subsys.go index 458d34c166..0eb68f758a 100644 --- a/internal/cgroups/subsys.go +++ b/internal/cgroups/subsys.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/subsys_test.go b/internal/cgroups/subsys_test.go index 757bb241bc..bf496ffb21 100644 --- a/internal/cgroups/subsys_test.go +++ b/internal/cgroups/subsys_test.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/cgroups/util_test.go b/internal/cgroups/util_test.go index 08e23e3ee4..17df0fd75c 100644 --- a/internal/cgroups/util_test.go +++ b/internal/cgroups/util_test.go @@ -34,6 +34,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. +//go:build linux // +build linux package cgroups diff --git a/internal/iruntime/total_memory_linux.go b/internal/iruntime/total_memory_linux.go index 30dd7c9cae..8048dcf8f8 100644 --- a/internal/iruntime/total_memory_linux.go +++ b/internal/iruntime/total_memory_linux.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package iruntime diff --git a/internal/iruntime/total_memory_linux_test.go b/internal/iruntime/total_memory_linux_test.go index ead751ae04..32904510c8 100644 --- a/internal/iruntime/total_memory_linux_test.go +++ b/internal/iruntime/total_memory_linux_test.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package iruntime diff --git a/internal/iruntime/total_memory_other.go b/internal/iruntime/total_memory_other.go index 2e7221a3a5..9e5c2e93c0 100644 --- a/internal/iruntime/total_memory_other.go +++ b/internal/iruntime/total_memory_other.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !linux // +build !linux package iruntime diff --git a/internal/iruntime/total_memory_other_test.go b/internal/iruntime/total_memory_other_test.go index 8819eb371f..7ba787466f 100644 --- a/internal/iruntime/total_memory_other_test.go +++ b/internal/iruntime/total_memory_other_test.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !linux // +build !linux package iruntime diff --git a/internal/tools/go.mod b/internal/tools/go.mod index d45c9501af..b964b4e69e 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/internal/tools -go 1.16 +go 1.17 require ( github.com/client9/misspell v0.3.4 @@ -15,3 +15,158 @@ require ( golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 golang.org/x/tools v0.1.5 ) + +require ( + 4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect + github.com/Antonboom/errname v0.1.3 // indirect + github.com/BurntSushi/toml v0.4.1 // indirect + github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/OpenPeeDeeP/depguard v1.0.1 // indirect + github.com/Songmu/retry v0.1.0 // indirect + github.com/alexkohler/prealloc v1.0.0 // indirect + github.com/ashanbrown/forbidigo v1.2.0 // indirect + github.com/ashanbrown/makezero v0.0.0-20210520155254-b6261585ddde // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/bombsimon/wsl/v3 v3.3.0 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/charithe/durationcheck v0.0.8 // indirect + github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af // indirect + github.com/daixiang0/gci v0.2.9 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/denis-tingajkin/go-header v0.4.2 // indirect + github.com/dgraph-io/ristretto v0.0.2 // indirect + github.com/esimonov/ifshort v1.0.2 // indirect + github.com/ettle/strcase v0.1.1 // indirect + github.com/fatih/color v1.12.0 // indirect + github.com/fatih/structtag v1.2.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/fzipp/gocyclo v0.3.1 // indirect + github.com/go-critic/go-critic v0.5.6 // indirect + github.com/go-toolsmith/astcast v1.0.0 // indirect + github.com/go-toolsmith/astcopy v1.0.0 // indirect + github.com/go-toolsmith/astequal v1.0.0 // indirect + github.com/go-toolsmith/astfmt v1.0.0 // indirect + github.com/go-toolsmith/astp v1.0.0 // indirect + github.com/go-toolsmith/strparse v1.0.0 // indirect + github.com/go-toolsmith/typep v1.0.2 // indirect + github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gofrs/flock v0.8.1 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect + github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 // indirect + github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a // indirect + github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect + github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect + github.com/golangci/misspell v0.3.5 // indirect + github.com/golangci/revgrep v0.0.0-20210208091834-cd28932614b5 // indirect + github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/go-cmp v0.5.5 // indirect + github.com/google/go-github v17.0.0+incompatible // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254 // indirect + github.com/gostaticanalysis/analysisutil v0.4.1 // indirect + github.com/gostaticanalysis/comment v1.4.1 // indirect + github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5 // indirect + github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/go-version v1.3.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jgautheron/goconst v1.5.1 // indirect + github.com/jingyugao/rowserrcheck v1.1.0 // indirect + github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect + github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d // indirect + github.com/kisielk/errcheck v1.6.0 // indirect + github.com/kisielk/gotool v1.0.0 // indirect + github.com/kulti/thelper v0.4.0 // indirect + github.com/kunwardeep/paralleltest v1.0.2 // indirect + github.com/kyoh86/exportloopref v0.1.8 // indirect + github.com/ldez/gomoddirectives v0.2.2 // indirect + github.com/ldez/tagliatelle v0.2.0 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/maratori/testpackage v1.0.1 // indirect + github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mbilski/exhaustivestruct v1.2.0 // indirect + github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 // indirect + github.com/mgechev/revive v1.1.0 // indirect + github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/moricho/tparallel v0.2.1 // indirect + github.com/nakabonne/nestif v0.3.0 // indirect + github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect + github.com/nishanths/exhaustive v0.2.3 // indirect + github.com/nishanths/predeclared v0.2.1 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/ory/viper v1.7.5 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/pelletier/go-toml v1.9.3 // indirect + github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/polyfloyd/go-errorlint v0.0.0-20210510181950-ab96adb96fea // indirect + github.com/prometheus/client_golang v1.7.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.10.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/quasilyte/go-ruleguard v0.3.4 // indirect + github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect + github.com/ryancurrah/gomodguard v1.2.3 // indirect + github.com/ryanrolds/sqlclosecheck v0.3.0 // indirect + github.com/sanposhiho/wastedassign/v2 v2.0.6 // indirect + github.com/securego/gosec/v2 v2.8.1 // indirect + github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sonatard/noctx v0.0.1 // indirect + github.com/sourcegraph/go-diff v0.6.1 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.3.1 // indirect + github.com/spf13/cobra v1.2.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.8.1 // indirect + github.com/ssgreg/nlreturn/v2 v2.1.0 // indirect + github.com/stretchr/objx v0.1.1 // indirect + github.com/stretchr/testify v1.7.0 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tcnksm/go-gitconfig v0.1.2 // indirect + github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect + github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b // indirect + github.com/tetafro/godot v1.4.8 // indirect + github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94 // indirect + github.com/tomarrell/wrapcheck/v2 v2.3.0 // indirect + github.com/tommy-muehle/go-mnd/v2 v2.4.0 // indirect + github.com/ultraware/funlen v0.0.3 // indirect + github.com/ultraware/whitespace v0.0.4 // indirect + github.com/uudashr/gocognit v1.0.5 // indirect + github.com/yeya24/promlinter v0.1.0 // indirect + go.opentelemetry.io/build-tools v0.0.0-20210719163622-92017e64f35b // indirect + golang.org/x/mod v0.4.2 // indirect + golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect + golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect + golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + honnef.co/go/tools v0.2.1 // indirect + mvdan.cc/gofumpt v0.1.1 // indirect + mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect + mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect + mvdan.cc/unparam v0.0.0-20210104141923-aac4ce9116a7 // indirect +) diff --git a/internal/tools/tools.go b/internal/tools/tools.go index 70147f27a4..45a1208c30 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build tools // +build tools package tools diff --git a/model/go.mod b/model/go.mod index db36091d48..79c3d2a857 100644 --- a/model/go.mod +++ b/model/go.mod @@ -1,6 +1,6 @@ module go.opentelemetry.io/collector/model -go 1.16 +go 1.17 require ( github.com/davecgh/go-spew v1.1.1 // indirect @@ -16,3 +16,9 @@ require ( gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) + +require ( + github.com/golang/protobuf v1.5.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/text v0.3.6 // indirect +) diff --git a/service/collector_windows.go b/service/collector_windows.go index 99e1f5e8ae..814a453ad6 100644 --- a/service/collector_windows.go +++ b/service/collector_windows.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package service diff --git a/service/collector_windows_test.go b/service/collector_windows_test.go index 53e6adce8b..a534235492 100644 --- a/service/collector_windows_test.go +++ b/service/collector_windows_test.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build windows // +build windows package service