Skip to content

Instantly share code, notes, and snippets.

@iancoffey
Created March 18, 2016 15:08
Show Gist options
  • Save iancoffey/12e8c1b17333b52921f6 to your computer and use it in GitHub Desktop.
Save iancoffey/12e8c1b17333b52921f6 to your computer and use it in GitHub Desktop.
Panic on trailing slash
// this is fine
icoffey@icoffey-ltm some-project (master)*$ GOOS=linux govendor update github.com/somerepo/some-project/mocks
icoffey@icoffey-ltm some-project (master)*$ echo $?
0
// doesnt exist, also fine
icoffey@icoffey-ltm some-project (master)*$ GOOS=linux govendor update github.com/somerepo/some-project/doesnt-exist
Error: Package "github.com/somerepo/some-project/doesnt-exist" not a go package or not in GOPATH.
// boom
icoffey@icoffey-ltm some-project (master)*$ GOOS=linux govendor update github.com/somerepo/some-project/mocks/
panic: Package "github.com/somerepo/some-project/mocks/" should be listed internally but is not.
goroutine 1 [running]:
panic(0x3ba280, 0xc8201ed4a0)
/usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
github.com/kardianos/govendor/context.(*Context).ModifyImport(0xc820147560, 0xc82006f6c0, 0xc820501802, 0x0, 0x0)
/Users/icoffey/go/src/github.com/kardianos/govendor/context/modify.go:140 +0x516
github.com/kardianos/govendor/run.Modify(0x8b1198, 0xc820092008, 0xc8200741a0, 0x1, 0x1, 0x2, 0x8b5900, 0xc8205d1db7, 0x0, 0x0, ...)
/Users/icoffey/go/src/github.com/kardianos/govendor/run/modify.go:113 +0xaa4
github.com/kardianos/govendor/run.Run(0x8b1198, 0xc820092008, 0xc820074180, 0x3, 0x3, 0x8b5900, 0xc8205d1db7, 0x0, 0x0, 0x0)
/Users/icoffey/go/src/github.com/kardianos/govendor/run/run.go:72 +0x554
main.main()
/Users/icoffey/go/src/github.com/kardianos/govendor/main.go:34 +0x453
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment