diff --git a/Makefile b/Makefile index e1ca9918ee..dc22f4002d 100644 --- a/Makefile +++ b/Makefile @@ -340,11 +340,7 @@ mockgen: #HELP Generate mocks # Consider using counterfeiter:generate directives to speed things up. # See https://github.com/maxbrunsfeld/counterfeiter#step-2b---add-counterfeitergenerate-directives for more information. # Set the "COUNTERFEITER_NO_GENERATE_WARNING" environment variable to suppress this message. - @set -e; \ - overlay_file=$$(mktemp "$(CURDIR)/hack/overlays/goimports_overlay.XXXXXX.json"); \ - trap 'rm -f "$$overlay_file"' EXIT; \ - printf '{\n "Replace": {\n "%s/vendor/golang.org/x/tools/imports/vendorlesspath.go": "%s/hack/overlays/goimports_vendorlesspath.go"\n }\n}\n' "$(CURDIR)" "$(CURDIR)" > "$$overlay_file"; \ - GO111MODULE=on GOWORK=off COUNTERFEITER_NO_GENERATE_WARNING=1 GOFLAGS="$$GOFLAGS -overlay=$$overlay_file" go generate ./pkg/... + GO111MODULE=on GOWORK=off COUNTERFEITER_NO_GENERATE_WARNING=1 go generate ./pkg/... #SECTION Verification diff --git a/hack/overlays/goimports_vendorlesspath.go b/hack/overlays/goimports_vendorlesspath.go deleted file mode 100644 index 4d1ab99221..0000000000 --- a/hack/overlays/goimports_vendorlesspath.go +++ /dev/null @@ -1,14 +0,0 @@ -package imports - -import "strings" - -// VendorlessPath returns ipath with any vendor prefixes trimmed. -func VendorlessPath(ipath string) string { - if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { - return ipath[i+len("/vendor/"):] - } - if strings.HasPrefix(ipath, "vendor/") { - return ipath[len("vendor/"):] - } - return ipath -}