Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

v48: restore: handle a case of empty GOPATH

Compare
Choose a tag to compare
@freeformz freeformz released this 13 Jan 22:15
· 87 commits to master since this release
When godep restore is executed with empty GOPATH, it fails with error
message like below:
$ godep restore
panic: runtime error: index out of range

goroutine 1 [running]:
main.download(0xc82012a000, 0x0, 0x0)
        /home/mitake/gopath/src/github.com/tools/godep/restore.go:104 +0x1cb8
main.runRestore(0xaffe00, 0xc82000a390, 0x0, 0x0)
        /home/mitake/gopath/src/github.com/tools/godep/restore.go:42 +0x3a5
main.main()
        /home/mitake/gopath/src/github.com/tools/godep/main.go:118 +0xd9f

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
        /usr/local/go/src/runtime/asm_amd64.s:1696 +0x1

This commit lets the command handle such a case with a little bit
grace error message like this:
$ godep restore
godep: Error restore requires GOPATH but it is empty.