forked from gopherjs/gopherjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Go 1.11 and GopherJS
Paul Jolly edited this page Nov 27, 2018
·
2 revisions
As of 4d506bd, GopherJS has almost complete support for Go modules. Like the go tool, gopherjs operates in one of two modes: module mode, or GOPATH mode. The logic behind mode selection matches the go tool.
- In GOPATH-mode, the build tag
gopherjsdevcan be supplied togopherjsto instruct GopherJS not to use its compile-time version ofgithub.com/gopherjs/gopherjs/.... In module-mode, the compiled versions of these packages are never used; they must always be resolvable viago.mod - None of GopherJS's commands (
install,buildetc) install dependencies by default. This is now much more in line with the behaviour of thegotool as a result of the build cache changes in Go 1.10.gopherjs installonly installs packages listed directly on the command line. Instead, a build cache is maintained and used which is much more robust when it comes to avoiding staleness. -
gopherjs runcan now take a single package argument. e.g.gopherjs run .orgopherjs run example.com/hello. The interpretation of arguments matches thegotool, as described in https://github.com/golang/go/issues/22726 -
gopherjs servebehaves slightly differently in module-mode when it comes to listing modules/packages. In GOPATH mode, it is possible to list directory contents beneath$GOPATH/src. There is not such concept in module-mode. Instead, the path must be to a valid module or package within a module in order for a list to succeed.
- There is not yet support for the
gotool flags-mod=readonly|vendor