From 71ff4511ef70602c78ce4d63918a96dd87d484fd Mon Sep 17 00:00:00 2001 From: Mark Sart Date: Mon, 4 Jan 2021 21:41:30 +0300 Subject: [PATCH] Closes #1633 --- .golangci.example.yml | 4 +++- pkg/lint/load.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.example.yml b/.golangci.example.yml index 7b96b313c2e6..184dbc292ed6 100644 --- a/.golangci.example.yml +++ b/.golangci.example.yml @@ -51,7 +51,9 @@ run: # If invoked with -mod=vendor, the go command assumes that the vendor # directory holds the correct copies of dependencies and ignores # the dependency descriptions in go.mod. - modules-download-mode: readonly|release|vendor + # If invoked with -mod=mod, the go command loads modules from the module cache + # even if there is a vendor directory present. + modules-download-mode: readonly|vendor|mod # Allow multiple parallel golangci-lint instances running. # If false (default) - golangci-lint acquires file lock on start. diff --git a/pkg/lint/load.go b/pkg/lint/load.go index 3525396bc56b..fd8e2e69b6e2 100644 --- a/pkg/lint/load.go +++ b/pkg/lint/load.go @@ -104,7 +104,7 @@ func (cl *ContextLoader) makeBuildFlags() ([]string, error) { mod := cl.cfg.Run.ModulesDownloadMode if mod != "" { // go help modules - allowedMods := []string{"release", "readonly", "vendor"} + allowedMods := []string{"readonly", "vendor", "mod"} var ok bool for _, am := range allowedMods { if am == mod {