Our make process always calls `go mod vendor` and we want the specific versions that are downloaded to be there - so much so that we commit `/vendor` (a commonly recommended action) to our git repo. To build using the main module's top-level vendor directory to satisfyĭependencies (disabling use of the usual network sources and local Packages from dependency modules that are needed to support builds and Vendor in the root directory of the main module and stores there all the Together in a single file tree, 'go mod vendor' creates a directory named Versions of Go, or to ensure that all files used for a build are stored When using modules, the go command completely ignores vendor directories.īy default, the go command satisfies dependencies by downloading modulesįrom their sources and using those downloaded copies (after verification,Īs described in the previous section). Here's from `go help modules` output: Modules and vendoring We have `replace` stanzas in our `go.mod` specifically to lock the related indirect library imports to a fixed version of an underlying library, those copies were brought into our `/vendor` dir on purpose using `go mod vendor`. I'd expect any use of a Go tool by the IDE to then respect that and set GOFLAGS="-mod=vendor". Yes, "Enable vendoring support automatically" is checked. It seems like I would want to set -mod=vendor as I have set for my external terminal env, but I don't know how one would set GOFLAGS items in GoLand GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gb/1lg9cbnj15g32lkhdrhdjbn80000gn/T/go-build098444412=/tmp/go-build -gno-record-gcc-switches -fno-common" GOMOD="/Users/btofel/workspace/operator-metering/go.mod" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOCACHE="/Users/btofel/Library/Caches/go-build" If I type go env at the internal terminal prompt I get: (master)$ go env Go: invalid pseudo-version: preceding tag (v3.9.0) not found Users/btofel/.gvm/gos/go1.13.9/bin/go list -m -json -mod= all #gosetup If it helps, I get Run output that is related to the libraries that can't be found: GOROOT=/Users/btofel/.gvm/gos/go1.13.9 #gosetup There are several replace stanzas as well, can add if needed. Project go.mod (partial): module /operator-framework/operator-metering Non-Bundled Plugins: BashSupport, PythonCore,, ,, Registry: =TRUE, =500, .ntext=true, .=TRUE, =TRUE VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o I've confirmed that those libraries are in the /vendor/ folder.īuild #GO-193.6911.30, built on March 20, 2020 But it is failing to find many imports in GoLand. I have project that is working okay with go modules at the command line.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |