go: vendor the oapi-codegen cmd

See the comment in tools.go, I cannot fully explain what's happening here.
Somehow, Go 1.14 wants to use the vendored version of oapi-codegen but
without this file, oapi-codegen isn't vendored so the generation fails.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-01-29 09:56:22 +01:00 committed by Ondřej Budai
parent 1a3cbb282a
commit 2241a8d9ed
75 changed files with 11211 additions and 0 deletions

15
internal/tools.go Normal file
View file

@ -0,0 +1,15 @@
// +build tools
// This file is here to just explicitly tell `go mod vendor` that we depend
// on oapi-codegen. Without this file, `go generate ./...` in Go >= 1.14 gets
// confused because oapi-codegen is not being vendored.
//
// This is apparently the conventional way, see:
// https://stackoverflow.com/questions/52428230/how-do-go-modules-work-with-installable-commands
// https://github.com/golang/go/issues/29516
package main
import (
_ "github.com/deepmap/oapi-codegen/cmd/oapi-codegen"
)