From efe41f2c0a5508ccf89257e5030b0204211fb15d Mon Sep 17 00:00:00 2001 From: pranav-new-relic <127438038+pranav-new-relic@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:51:08 +0530 Subject: [PATCH] =?UTF-8?q?feat(build):=20upgrade=20to=20Go=20v1.21=20?= =?UTF-8?q?=E2=9C=A8=20(#1128)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/compile.yml | 4 ++-- .github/workflows/generate.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 12 ++++++------ README.md | 4 ++-- build/tools.mk | 2 +- go.mod | 2 +- pkg/testhelpers/helpers.go | 4 ++-- tools/go.mod | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 93c361351..2b0397aa6 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -18,9 +18,9 @@ jobs: runs-on: ${{ matrix.platform }} steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 097fb72c4..67a2a518f 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -9,9 +9,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b7086511..c9068c181 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fda2e4009..8c45186cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH @@ -39,9 +39,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH @@ -79,9 +79,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19.x + go-version: 1.21.x - name: Add GOBIN to PATH run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH diff --git a/README.md b/README.md index 6df286984..b0ef15dc6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Follow the steps below to add `github.com/newrelic/newrelic-client-go` as a depe ``` module example.com/yourmodule - go 1.19 + go 1.21 require ( github.com/newrelic/newrelic-client-go/v2 v2.0.1 @@ -131,7 +131,7 @@ Keep in mind that when you submit your pull request, you'll need to sign the CLA ### Requirements -- Go 1.19+ +- Go 1.21+ - GNU Make - git diff --git a/build/tools.mk b/build/tools.mk index 554c6d060..18793bfcd 100644 --- a/build/tools.mk +++ b/build/tools.mk @@ -11,7 +11,7 @@ BUILD_DIR ?= ./bin/ TOOL_DIR ?= tools TOOL_CONFIG ?= $(TOOL_DIR)/tools.go -GOTOOLS ?= $(shell cd $(TOOL_DIR) && go list -f '{{ .Imports }}' -tags tools |tr -d '[]') +GOTOOLS ?= $(shell cd $(TOOL_DIR) && go list -e -f '{{ .Imports }}' -tags tools |tr -d '[]') tools: check-version @echo "=== $(PROJECT_NAME) === [ tools ]: Installing tools required by the project..." diff --git a/go.mod b/go.mod index 33f6f22cb..a35a78f25 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/newrelic/newrelic-client-go/v2 -go 1.19 +go 1.21 require ( github.com/elazarl/goproxy v0.0.0-20231117061959-7cc037d33fb5 diff --git a/pkg/testhelpers/helpers.go b/pkg/testhelpers/helpers.go index f25284f22..2666fa73e 100644 --- a/pkg/testhelpers/helpers.go +++ b/pkg/testhelpers/helpers.go @@ -5,7 +5,6 @@ import ( "math/rand" "os" "strconv" - "time" ) var ( @@ -21,7 +20,8 @@ const IntegrationTestAccountID = 3806526 // RandSeq is used to get a string made up of n random lowercase letters. func RandSeq(n int) string { - rand.Seed(time.Now().UnixNano()) + // commented the following line out, since this no longer works with go1.21 and needs no alternative, as seeding isn't needed + // rand.Seed(time.Now().UnixNano()) b := make([]rune, n) for i := range b { b[i] = letters[rand.Intn(len(letters))] diff --git a/tools/go.mod b/tools/go.mod index 407c08d63..5a599fa02 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/newrelic/newrelic-client-go/v2/tools -go 1.19 +go 1.21 require ( github.com/caarlos0/svu v1.9.0