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:
parent
1a3cbb282a
commit
2241a8d9ed
75 changed files with 11211 additions and 0 deletions
25
vendor/github.com/deepmap/oapi-codegen/pkg/codegen/extension.go
generated
vendored
Normal file
25
vendor/github.com/deepmap/oapi-codegen/pkg/codegen/extension.go
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package codegen
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
extPropGoType = "x-go-type"
|
||||
)
|
||||
|
||||
func extTypeName(extPropValue interface{}) (string, error) {
|
||||
raw, ok := extPropValue.(json.RawMessage)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("failed to convert type: %T", extPropValue)
|
||||
}
|
||||
var name string
|
||||
if err := json.Unmarshal(raw, &name); err != nil {
|
||||
return "", errors.Wrap(err, "failed to unmarshal json")
|
||||
}
|
||||
|
||||
return name, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue