From 002f2fb1802db3ec2ffb783cb018cfc5c3e321f1 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Tue, 23 Aug 2022 14:31:52 +0000 Subject: [PATCH 1/4] bump go.mod to Go 1.18 and run go fix --- go.mod | 2 +- netroute_bsd.go | 1 - netroute_linux.go | 1 - netroute_stub.go | 1 - netroute_windows.go | 1 - sockaddr_windows.go | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 5b5b15c..56c8de1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/libp2p/go-netroute -go 1.17 +go 1.18 require ( github.com/google/gopacket v1.1.19 diff --git a/netroute_bsd.go b/netroute_bsd.go index 85304d9..cad94a9 100644 --- a/netroute_bsd.go +++ b/netroute_bsd.go @@ -5,7 +5,6 @@ // tree. //go:build darwin || dragonfly || freebsd || netbsd || openbsd -// +build darwin dragonfly freebsd netbsd openbsd // This is a BSD import for the routing structure initially found in // https://github.com/google/gopacket/blob/master/routing/routing.go diff --git a/netroute_linux.go b/netroute_linux.go index 5994d46..1f039db 100644 --- a/netroute_linux.go +++ b/netroute_linux.go @@ -5,7 +5,6 @@ // tree. //go:build linux -// +build linux // Generate a local routing table structure following the code at // https://github.com/google/gopacket/blob/master/routing/routing.go diff --git a/netroute_stub.go b/netroute_stub.go index 68fbd4a..1235b45 100644 --- a/netroute_stub.go +++ b/netroute_stub.go @@ -1,7 +1,6 @@ // A stub routing table conformant interface for js/wasm environments. //go:build js && wasm -// +build js,wasm package netroute diff --git a/netroute_windows.go b/netroute_windows.go index d938316..505c2e3 100644 --- a/netroute_windows.go +++ b/netroute_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package netroute diff --git a/sockaddr_windows.go b/sockaddr_windows.go index 8d8d7b6..88f45d0 100644 --- a/sockaddr_windows.go +++ b/sockaddr_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package netroute From b33053a657f3a377f46b2096be2c1dba9543a825 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Tue, 23 Aug 2022 14:31:53 +0000 Subject: [PATCH 2/4] run gofmt -s --- common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common.go b/common.go index 7836e5e..3035517 100644 --- a/common.go +++ b/common.go @@ -6,8 +6,8 @@ // Originally found in // https://github.com/google/gopacket/blob/master/routing/routing.go -// * Route selection modified to choose most selective route -// to break ties when route priority is insufficient. +// - Route selection modified to choose most selective route +// to break ties when route priority is insufficient. package netroute import ( From 772921644b1b1a7cbc87e8523fab587c180bb51d Mon Sep 17 00:00:00 2001 From: web3-bot Date: Tue, 23 Aug 2022 14:31:53 +0000 Subject: [PATCH 3/4] update .github/workflows/go-test.yml --- .github/workflows/go-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index b86241a..8a1697b 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -10,16 +10,16 @@ jobs: fail-fast: false matrix: os: [ "ubuntu", "windows", "macos" ] - go: [ "1.17.x", "1.18.x" ] + go: [ "1.18.x", "1.19.x" ] env: COVERAGES: "" runs-on: ${{ format('{0}-latest', matrix.os) }} name: ${{ matrix.os }} (go ${{ matrix.go }}) steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - name: Go information @@ -43,7 +43,7 @@ jobs: # Use -coverpkg=./..., so that we include cross-package coverage. # If package ./A imports ./B, and ./A's tests also cover ./B, # this means ./B's coverage will be significantly higher than 0%. - run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./... + run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./... - name: Run tests (32 bit) if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. uses: protocol/multiple-go-modules@v1.2 @@ -52,7 +52,7 @@ jobs: with: run: | export "PATH=${{ env.PATH_386 }}:$PATH" - go test -v ./... + go test -v -shuffle=on ./... - name: Run tests with race detector if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow uses: protocol/multiple-go-modules@v1.2 @@ -62,7 +62,7 @@ jobs: shell: bash run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV - name: Upload coverage to Codecov - uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0 + uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 with: files: '${{ env.COVERAGES }}' env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }} From 4d5e983a0d6d6cc6373b83d95dac669fd892f471 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Tue, 23 Aug 2022 14:31:53 +0000 Subject: [PATCH 4/4] update .github/workflows/go-check.yml --- .github/workflows/go-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index 25e1afd..251f7fa 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -11,12 +11,12 @@ jobs: env: RUNGOGENERATE: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: "1.18.x" + go-version: "1.19.x" - name: Run repo-specific setup uses: ./.github/actions/go-check-setup if: hashFiles('./.github/actions/go-check-setup') != '' @@ -27,7 +27,7 @@ jobs: echo "RUNGOGENERATE=true" >> $GITHUB_ENV fi - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@d7e217c1ff411395475b2971c0824e1e7cc1af98 # 2022.1 (v0.3.0) + run: go install honnef.co/go/tools/cmd/staticcheck@376210a89477dedbe6fdc4484b233998650d7b3c # 2022.1.3 (v0.3.3) - name: Check that go.mod is tidy uses: protocol/multiple-go-modules@v1.2 with: