Skip to content

Commit

Permalink
replace gobindata with go:embed
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisawind committed Jan 18, 2022
1 parent 2d026c2 commit d691b47
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 1,584 deletions.
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ coverage:
patch:
default:
target: 80%
ignore: generator/bindata.go
3 changes: 0 additions & 3 deletions .githooks/pre-commit/50-regen-bindata

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/check_bindata.yaml

This file was deleted.

12 changes: 1 addition & 11 deletions docs/guidelines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,7 @@ The whole `go-openapi` and `go-swagger` has adopted go modules and no more use v

`go-swagger` is built with an in-memory image of templates.

Binary encoded assets are auto-generated from the `generator/templates` directory using `bindata`
(the result is `generator/bindata.go`).

While developing, you may work with dynamically updated templates (i.e. no need to rebuild)
using `bindata.go` generated in debug mode (use script: `./generator/gen-debug.sh`).

There is a `.githook` script configured as pre-commit: if you configure githooks locally for this repo,
every time you commit,`generator/bindata.go`
will be regenerated and added to the current commit (without debug mode).

For `bindata` please use the fork found at: `github.com/kevinburke/go-bindata`.
Binary encoded assets are auto-generated from the `generator/templates` directory using `go:embed`.

> **NOTE**: we are carrying out unit tests on codegen mostly by asserting lines in generated code.
> There is a bunch of test utility functions for this. See `generator/*_test.go`.
Expand Down
1,516 changes: 20 additions & 1,496 deletions generator/bindata.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions generator/gen-debug.sh

This file was deleted.

2 changes: 0 additions & 2 deletions generator/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import (
"github.com/go-openapi/swag"
)

//go:generate go-bindata -mode 420 -modtime 1482416923 -pkg=generator -ignore=.*\.sw? -ignore=.*\.md ./templates/...

const (
// default generation targets structure
defaultModelsTarget = "models"
Expand Down
2 changes: 0 additions & 2 deletions hack/devtools.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
go get -u -v golang.org/x/tools/cmd/...
go get -u -v github.com/kevinburke/go-bindata/go-bindata
go get -u -v github.com/elazarl/go-bindata-assetfs/...
go get -u -v github.com/axw/gocov/gocov
go get -u -v github.com/matm/gocov-html
go get -u -v github.com/AlekSi/gocov-xml
Expand Down
2 changes: 0 additions & 2 deletions hack/devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
export GO111MODULE=off

go get -u -v golang.org/x/tools/cmd/...
go get -u -v github.com/kevinburke/go-bindata/go-bindata
go get -u -v github.com/elazarl/go-bindata-assetfs/...
go get -u -v github.com/axw/gocov/gocov
go get -u -v github.com/matm/gocov-html
go get -u -v github.com/AlekSi/gocov-xml
Expand Down
42 changes: 0 additions & 42 deletions hack/validate-bindata.sh

This file was deleted.

0 comments on commit d691b47

Please sign in to comment.