Skip to content

x/vgo getmode=vendor not using vendor directory #26126

Closed
@RichyHBM

Description

@RichyHBM

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

$ vgo version
go version go1.10.3 linux/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Yes

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

$ vgo env
GOARCH="amd64"
GOBIN="/home/richy/.bin"
GOCACHE="/home/richy/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/richy/go"
GOPROXY=""
GORACE=""
GOROOT="/home/linuxbrew/.linuxbrew/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/home/linuxbrew/.linuxbrew/Cellar/go/1.10.3/libexec/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc-5"
CXX="g++-5"
CGO_ENABLED="1"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build522635311=/tmp/go-build -gno-record-gcc-switches"
VGOMODROOT="/home/richy/repos/temp"

What did you do?

Starting with

$ ls
go.mod  main.go

$ cat go.mod
module temp

require (
        github.com/gorilla/context v1.1.1
        github.com/gorilla/mux v1.6.2
)

$ cat main.go
package main

import (
        "net/http"
        "github.com/gorilla/mux"
)

func handler(w http.ResponseWriter, r *http.Request) {
        return
}

func main() {
        r := mux.NewRouter()
        r.HandleFunc("/", handler)
}
$ vgo build
$ vgo mod -vendor
$ vgo build -getmode=vendor
$ rm -rf ~/go/src/mod/
$ vgo build -getmode=vendor

What did you expect to see?

$ vgo build
vgo: downloading github.com/gorilla/mux v1.6.2
$ vgo mod -vendor
vgo: downloading github.com/gorilla/context v1.1.1
$ vgo build -getmode=vendor
$ rm -rf ~/go/src/mod/
$ vgo build -getmode=vendor
$

What did you see instead?

$ vgo build
vgo: downloading github.com/gorilla/mux v1.6.2

$ vgo mod -vendor
vgo: downloading github.com/gorilla/context v1.1.1

$ vgo build -getmode=vendor

$ rm -rf ~/go/src/mod/

$ vgo build -getmode=vendor
vgo: github.com/gorilla/mux v1.6.2: module lookup disabled by -getmode=vendor
vgo: github.com/gorilla/context v1.1.1: module lookup disabled by -getmode=vendor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions