Skip to content

Commit

Permalink
chore(*) improve go mod handling in 1.14
Browse files Browse the repository at this point in the history
Having a folder called `vendor` confises go 1.14. Rename it to `vendored`
and this solves many potential issues. Including the need to pass `-mod=mod`
in many cases.

https://github.com/Kong/kuma/pull/718#issuecomment-625894360

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
  • Loading branch information
Nikolay Nikolaev committed Jun 5, 2020
1 parent d466650 commit 4d11547
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ go.sum
Makefile*
pkg/*
!pkg/config/*
vendor
vendored
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ build_info_ld_flags := $(foreach entry,$(build_info_fields), -X github.com/Kong/
LD_FLAGS := -ldflags="-s -w $(build_info_ld_flags)"
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
GOFLAGS := -mod=mod
GOFLAGS :=
GO_BUILD := GOOS=${GOOS} GOARCH=${GOARCH} CGO_ENABLED=0 go build -v $(GOFLAGS) $(LD_FLAGS)
GO_RUN := CGO_ENABLED=0 go run $(GOFLAGS) $(LD_FLAGS)
GO_TEST := go test $(GOFLAGS) $(LD_FLAGS)
Expand Down Expand Up @@ -243,7 +243,7 @@ golangci-lint: ## Dev: Runs golangci-lint linter
$(GOLANGCI_LINT_DIR)/golangci-lint run -v

imports: ## Dev: Runs goimports in order to organize imports
goimports -w -local github.com/Kong/kuma -d `find . -type f -name '*.go' -not -name '*.pb.go' -not -path './vendor/*'`
goimports -w -local github.com/Kong/kuma -d `find . -type f -name '*.go' -not -name '*.pb.go' -not -path './vendored/*'`

check: generate fmt vet docs golangci-lint imports tidy ## Dev: Run code checks (go fmt, go vet, ...)
make generate manifests -C pkg/plugins/resources/k8s/native
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ replace (
github.com/Kong/kuma/api => ./api
github.com/Kong/kuma/pkg/plugins/resources/k8s/native => ./pkg/plugins/resources/k8s/native

github.com/prometheus/prometheus => ./vendor/github.com/prometheus/prometheus
github.com/prometheus/prometheus => ./vendored/github.com/prometheus/prometheus
github.com/spiffe/spire/proto/spire => github.com/spiffe/spire/proto/spire v0.10.0
gopkg.in/fsnotify.v1 => gopkg.in/fsnotify.v1 v1.4.7
k8s.io/client-go => k8s.io/client-go v0.18.2
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/resources/k8s/native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bin

# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*
!vendored/**/zz_generated.*

# editor and IDE paraphernalia
.idea
Expand Down
File renamed without changes.

0 comments on commit 4d11547

Please sign in to comment.