Skip to content

gopherjs get: Does not work reliably. #270

@dmitshur

Description

@dmitshur

For example:

$ export GOPATH=/tmp/clean_empty_workspace
$ go get -u github.com/gopherjs/gopherjs
$ $GOPATH/bin/gopherjs get github.com/shurcooL/play/113
cannot find package "honnef.co/go/js/dom" in any of:
    /usr/local/go/src/honnef.co/go/js/dom (from $GOROOT)
    /tmp/clean_empty_workspace/src/honnef.co/go/js/dom (from $GOPATH)

On the other hand, using go get with js build tag works:

$ go get -d -tags=js github.com/shurcooL/play/113

Additionally, gopherjs get is missing -u flag and some others.

Proposed Solutions

The logic of go get is quite complicated, and it tends to move forward with each point release of Go.

I see clear value to have gopherjs build, gopherjs install that mimic those commands of go tool. gopherjs serve is also extremely useful. In constrast, gopherjs get seems completely unneeded because you can always use go get with -d and -tags=js, followed by gophers install to simulate what gopherjs get is expected to achieve:

# gopherjs get import/path
go get -d -tags=js import/path
gopherjs install import/path

At this time, I think the best solution to this issue is to remove gopherjs get command. It will mean less maintenance and I think it's simpler for users.

Alternatives are:

  • Make gopherjs get work more reliably by shelling out to go get (should be quite easy).
  • Do all the work of fixing the problems/missing features in source code (would be quite hard IMO, and require much more future maintenance).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions