From adfc2652b5f158c68912cac817473669a64ff1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 9 Feb 2023 11:25:47 +0100 Subject: [PATCH] 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. --- internal/tools/tools.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 internal/tools/tools.go diff --git a/internal/tools/tools.go b/internal/tools/tools.go new file mode 100644 index 00000000..d4ad233b --- /dev/null +++ b/internal/tools/tools.go @@ -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" +)