Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go get -t ignores vendor folder #11717

Closed
azylman opened this issue Jul 14, 2015 · 2 comments
Closed

cmd/go: go get -t ignores vendor folder #11717

azylman opened this issue Jul 14, 2015 · 2 comments
Milestone

Comments

@azylman
Copy link

azylman commented Jul 14, 2015

Version of Go:
go version devel +b6ead9f Tue Jul 7 21:53:11 2015 +0000 linux/amd64

OS and architecture:
linux/amd64 (ubuntu 14.04)

What did I do:
Ran go get -t with vendoring turned on, expected it to only try to download test dependencies that didn't exist, like go get

What did I see instead:
It tried to download dependencies that already existed in the vendor/ folder

Reproducing:

Project hierarchy (located in $GOPATH/src/github.com/azylman/demo):

main.go
main_test.go
vendor/
  example.org/
    thing/
      thing.go

Files:

// main.go
package main

import (
    "fmt"

    "example.org/thing"
)

func main() {
    fmt.Println(thing.One, thing.Two)
}
// main_test.go
package main

import (
    "fmt"
    "testing"

    "example.org/thing"
)

func TestNothing(t *testing.T) {
    fmt.Println(thing.One)
}
// vendor/example.org/thing/thing.go
package thing

const (
    One = iota + 1
    Two
)

Output:

$ export GO15VENDOREXPERIMENT=1

$ go run main.go
1 2

$ go test
1
PASS
ok      github.com/azylman/demo 0.006s

$ go get

$ go get -t
package example.org/thing: unrecognized import path "example.org/thing"
@adg
Copy link
Contributor

adg commented Jul 14, 2015

cc @rsc

Not sure if this was fixed by a recent change (probably not).

@adg adg assigned rsc Jul 14, 2015
@adg adg added this to the Go1.5 milestone Jul 14, 2015
@ianlancetaylor ianlancetaylor assigned ianlancetaylor and unassigned rsc Jul 21, 2015
@gopherbot
Copy link

CL https://golang.org/cl/12488 mentions this issue.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants