From b76bd8c590a1826399d425716f7e8d71c8ce5350 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 31 May 2023 05:50:18 -0700 Subject: [PATCH 1/2] mod: Use latest /x/tools, use Go 1.18 Upgrades to the latest release of /x/tools and friends. This is necessary to fix errors during `go test` similar to: This fixes errors like this: internal error: package "bytes" without types was imported from "command-line-arguments" Supersedes #231 --- go.mod | 9 +++++++-- go.sum | 36 +++++++----------------------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index fbe62c9..1c67aa8 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,10 @@ module github.com/kisielk/errcheck -go 1.14 +go 1.18 -require golang.org/x/tools v0.1.10 +require golang.org/x/tools v0.9.1 + +require ( + golang.org/x/mod v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect +) diff --git a/go.sum b/go.sum index 3f735d1..cf10794 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,7 @@ -github.com/yuin/goldmark v1.4.1/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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -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/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -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= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= From 531d8f3d839d02fcb832c79e730118645bdc3fe5 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 31 May 2023 05:52:43 -0700 Subject: [PATCH 2/2] ci: Test against Go 1.18-1.20 Switch CI to only test against Go 1.18 to 1.20. Per the Go support policy, only 1.19 and 1.20 are currently supported, but I've left 1.18 in there to support stragglers. To reduce duplication in the CI job, this also switches to a test matrix instead of copy-pasting the steps between each job. --- .github/workflows/errcheck.yml | 76 ++++------------------------------ 1 file changed, 9 insertions(+), 67 deletions(-) diff --git a/.github/workflows/errcheck.yml b/.github/workflows/errcheck.yml index 532c8ae..7926a78 100644 --- a/.github/workflows/errcheck.yml +++ b/.github/workflows/errcheck.yml @@ -7,77 +7,19 @@ on: branches: [ master ] jobs: - build_go112: - name: 'go 1.12.x' + build: + strategy: + matrix: + go: ["1.18.x", "1.19.x", "1.20.x"] + name: go ${{ matrix.go }} runs-on: ubuntu-latest - env: - GO111MODULE: 'on' - steps: - - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.12.17 - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... - build_go113: - name: 'go 1.13.x' - runs-on: ubuntu-latest - env: - GO111MODULE: 'on' - steps: - - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.13.15 - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... - build_go114: - name: 'go 1.14.x' - runs-on: ubuntu-latest - env: - GO111MODULE: 'on' - steps: - - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.14.12 - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... - build_go115: - name: 'go 1.15.x' - runs-on: ubuntu-latest - env: - GO111MODULE: 'on' - steps: - - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.15.6 - - name: Build - run: go build -v ./... - - name: Test - run: go test -v ./... - build_go118: - name: 'go 1.18.x' - runs-on: ubuntu-latest - env: - GO111MODULE: 'on' + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version: ${{ matrix.go }} - name: Build run: go build -v ./... - name: Test