"cannot find package" errors could be more informative
Consider this error from gopherjs build:
cannot find package "github.com/flimzy/flashback/pages" in any of:
/usr/local/go/src/github.com/flimzy/flashback/pages (from $GOROOT)
/home/jonhall/go/src/github.com/flimzy/flashback/pages (from $GOPATH)
It's almost identical to the same error from go build:
cmd/server/server.go:4:2: cannot find package "oink" in any of:
/usr/local/go/src/oink (from $GOROOT)
/home/jonhall/go/src/oink (from $GOPATH)
Except that the go version tells me where the missing dependency is referenced ("cmd/server.go:4:2").
It would be very handy if GopherJS did the same thing :)
Agreed, this should be improved so gopherjs build output shows the filename and line number information just like go build does.
I've looked into this, it turns out it's a regression caused by commit https://github.com/gopherjs/gopherjs/commit/642a7f3fafe4dc7c01179a830271aadd54641fdd which attempted to fix #119.
I'll make a PR that resolves this issue. Edit: Done in https://github.com/gopherjs/gopherjs/pull/291.
Despite #291, this seems to still be an issue:
package main
import (
_ "oink"
)
func main() {
}
$ gopherjs build
cannot find package "oink" in any of:
/usr/local/go/src/oink (from $GOROOT)
($GOPATH not set. For more details see: 'go help gopath')