Skip to content

Commit a622fcf

Browse files
authored
chore: test with go 1.20 and cleanup tooling (#444)
* chore: test with go 1.20 and cleanup tooling * chore: remove labeler * Downgrade to swagger 0.24 * chore: remove go 1.16 and 1.17 * chore: install go-swagger
1 parent 8d82c24 commit a622fcf

18 files changed

+210
-119
lines changed

.github/workflows/labeler.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
node_version: ['*']
1818
runs-on: ${{ matrix.os }}
1919
steps:
20-
- name: Install Node.js ${{ matrix.node }}
20+
- name: Install Node.js ${{ matrix.node_version }}
2121
uses: actions/setup-node@v2
2222
with:
2323
node-version: ${{ matrix.node_version }}
@@ -33,10 +33,10 @@ jobs:
3333
strategy:
3434
matrix:
3535
os: [ubuntu-latest, macOS-latest, windows-latest]
36-
go_version: [1.17.x, 1.18.x, 1.19.x]
36+
go_version: [1.19.x, 1.20.x]
3737
runs-on: ${{ matrix.os }}
3838
steps:
39-
- name: Install Go ${{ matrix.go }}
39+
- name: Install Go ${{ matrix.go_version }}
4040
uses: actions/[email protected]
4141
with:
4242
go-version: ${{ matrix.go_version }}

.github/workflows/verify-go-src.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
go_version: [1.19.x]
16+
go_version: [1.20.x]
1717
runs-on: ${{ matrix.os }}
1818
steps:
19-
- name: Install Go ${{ matrix.go }}
19+
- name: Install Go ${{ matrix.go_version }}
2020
uses: actions/[email protected]
2121
with:
2222
go-version: ${{ matrix.go_version }}

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ The go-client is an [netlify/open-api][open-api] derived http client generated u
88
- You have cloned this repo OUTSIDE of the go path. (So go modules work).
99
- You have a $GOPATH set up and $GOPATH/bin is added to your \$PATH
1010

11-
See [GMBE:Tools as dependencies](https://github.com/go-modules-by-example/index/tree/master/010_tools) and [GMBE:Using `gobin` to install/run tools](https://github.com/go-modules-by-example/index/tree/master/017_using_gobin) for a deeper explanation of how a tools.go file works.
12-
1311
## Spec validation
1412

1513
All spec changes must pass go-swagger spec validation.
@@ -53,7 +51,6 @@ under its [MIT license](LICENSE).
5351
[goreport]: https://goreportcard.com/report/github.com/netlify/go-client
5452
[git-img]: https://img.shields.io/github/release/netlify/go-client.svg
5553
[git]: https://github.com/netlify/go-client/releases/latest
56-
[gobin]: https://github.com/myitcv/gobin
5754
[modules]: https://github.com/golang/go/wiki/Modules
5855
[open-api]: https://github.com/netlify/open-api
5956
[go-swagger]: https://github.com/go-swagger/go-swagger

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.PHONY: all build deps generate help test validate
2-
CHECK_FILES?=$$(go list ./... | grep -v /vendor/)
32
SWAGGER_SPEC=swagger.yml
43

54
help: ## Show this help.
@@ -11,13 +10,13 @@ build: ## Build the API Go client.
1110
go build ./go/...
1211

1312
deps: ## Download dependencies.
14-
GO111MODULE=off go get -u github.com/myitcv/gobin && go mod download
13+
go mod download
1514

1615
generate: validate ## Generate the API Go client and the JSON document for the UI.
1716
go generate
1817

1918
test: ## Test the go code.
20-
gobin -m -run github.com/kyoh86/richgo test -v $(CHECK_FILES)
19+
go test -v ./...
2120

2221
validate: deps ## Check that the swagger spec is valid.
23-
gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger@v0.23.0 validate $(SWAGGER_SPEC)
22+
go run github.com/go-swagger/go-swagger/cmd/swagger validate $(SWAGGER_SPEC)

generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package tools
22

33
// todo: Find a better way to ignore tags or make a breaking release
4-
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger flatten swagger.yml -o swagger_flat.json
4+
//go:generate go run github.com/go-swagger/go-swagger/cmd/swagger flatten swagger.yml -o swagger_flat.json
55
//go:generate sh -c "cat swagger_flat.json | jq '[., (.paths | map_values(.[] |= del(.tags?)) | {paths: .})] | add' > swagger_go.json"
6-
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger generate client -A netlify -f swagger_go.json -t go -c plumbing --default-scheme=https --with-flatten=full
6+
//go:generate go run github.com/go-swagger/go-swagger/cmd/swagger generate client -A netlify -f swagger_go.json -t go -c plumbing --default-scheme=https --with-flatten=full

go.mod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ require (
1010
github.com/go-openapi/strfmt v0.19.11
1111
github.com/go-openapi/swag v0.19.12
1212
github.com/go-openapi/validate v0.20.0
13-
github.com/go-swagger/go-swagger v0.23.0
14-
github.com/kyoh86/richgo v0.3.3
15-
github.com/myitcv/gobin v0.0.14
13+
github.com/go-swagger/go-swagger v0.24.0
1614
github.com/pkg/errors v0.9.1
17-
github.com/rogpeppe/go-internal v1.9.0 // indirect
1815
github.com/rsc/goversion v1.2.0
1916
github.com/sirupsen/logrus v1.6.0
20-
github.com/stretchr/testify v1.7.0
17+
github.com/stretchr/testify v1.8.2
2118
golang.org/x/net v0.7.0 // indirect
2219
)

0 commit comments

Comments
 (0)