Skip to content

cmd/go: document that go mod vendor ignores directories that do not contain Go files #57529

@urandom2

Description

@urandom2

What version of Go are you using (go version)?

$ go version
go1.19.4

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/user/.cache/go-build"
GOENV="/home/user/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/user/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/colin/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/nix/store/a7875alzpnr46z6mv4ssymfdwmvr6xbq-go-1.19.4/share/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/nix/store/a7875alzpnr46z6mv4ssymfdwmvr6xbq-go-1.19.4/share/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3977569072=/tmp/go-build -gno-record-gcc-switches"

What did you do?

[user@localhost:~]$ git clone https://github.com/ava-labs/avalanchego
[user@localhost:~]$ cd avalanchego
[user@localhost:avalanchego]$ go build -o /dev/null ./main
[user@localhost:avalanchego]$ go mod vendor

What did you expect to see?

[user@localhost:avalanchego]$ go build -o /dev/null ./main

What did you see instead?

[user@localhost:avalanchego]$ go build -o /dev/null ./main
# github.com/supranational/blst/bindings/go
vendor/github.com/supranational/blst/bindings/go/blst.go:16:11: fatal error: blst.h: No such file or directory
   16 | // #include "blst.h"
      |           ^~~~~~~~
compilation terminated.
# github.com/zondax/hid
vendor/github.com/zondax/hid/hid_enabled.go:23:18: fatal error: os/threads_posix.c: No such file or directory
   23 |         #include "os/threads_posix.c"
      |                  ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions