Closed
Description
Background
go-storage
has build a codegen definitions
(cmd/definitions) to help generated code for our services. And services will call the codegen in doc.go
like:
package s3
//go:generate go run -tags tools github.com/beyondstorage/go-storage/v4/cmd/definitions service.toml
But new contributors could miss the code generate and send PRs with not generated code. So It's better to add a check to make sure our generated.go
generated correctly.
Moreover, this workflow checks not only geneated.go
but also go.mod
/ go.sum
and so on.
Action
We can add a new workflow called diff_check.yml
in which we:
- setup-go
- checkout services
- run
make build
- run
git diff
and make sure the output is empty (just we did forgofmt
)