Add internal/tools/tools.go to mock-import code generator packages

`internal/tools/tools.go` is a bit of a hacky workaround a limitation of
`go mod tidy`. It will never be built, but `go mod tidy` will see the
packages imported here as dependencies of the Flamenco project, and not
remove them from `go.mod`.

This is meant for build-time requirements that are otherwise never
imported as Go libraries, like our OpenAPI code generator.
This commit is contained in:
Sybren A. Stüvel 2023-02-09 11:25:47 +01:00
parent 426b2aab4d
commit adfc2652b5

13
internal/tools/tools.go Normal file

@ -0,0 +1,13 @@
//go:build tools
// This file is a bit of a hacky workaround a limitation of `go mod tidy`. It
// will never be built, but `go mod tidy` will see the packages imported here as
// dependencies of the Flamenco project, and not remove them from `go.mod`.
package main
import (
// Go code generators:
_ "github.com/deepmap/oapi-codegen/cmd/oapi-codegen"
_ "github.com/golang/mock/mockgen"
)