Skip to content

Commit 480cd60

Browse files
authored
Merge pull request gopherjs#1146 from gopherjs/README-go-install
README: suggest go install for installing
2 parents fda6a40 + dad1371 commit 480cd60

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ GopherJS - A compiler from Go to JavaScript
55
[![Sourcegraph](https://sourcegraph.com/github.com/gopherjs/gopherjs/-/badge.svg)](https://sourcegraph.com/github.com/gopherjs/gopherjs?badge)
66
[![Circle CI](https://circleci.com/gh/gopherjs/gopherjs.svg?style=svg)](https://circleci.com/gh/gopherjs/gopherjs)
77

8-
GopherJS compiles Go code ([golang.org](https://golang.org/)) to pure JavaScript code. Its main purpose is to give you the opportunity to write front-end code in Go which will still run in all browsers.
8+
GopherJS compiles Go code ([go.dev](https://go.dev/)) to pure JavaScript code. Its main purpose is to give you the opportunity to write front-end code in Go which will still run in all browsers.
99

1010
### Help us make GopherJS better!
1111

@@ -33,20 +33,20 @@ Nearly everything, including Goroutines ([compatibility documentation](https://g
3333
### Installation and Usage
3434

3535
GopherJS [requires Go 1.18 or newer](https://github.com/gopherjs/gopherjs/blob/master/doc/compatibility.md#go-version-compatibility). If you need an older Go
36-
version, you can use an [older Gopher release](https://github.com/gopherjs/gopherjs/releases).
36+
version, you can use an [older GopherJS release](https://github.com/gopherjs/gopherjs/releases).
3737

38-
Get or update GopherJS and dependencies with:
38+
Install GopherJS with `go install`:
3939

4040
```
41-
go get -u github.com/gopherjs/gopherjs
41+
go install github.com/gopherjs/gopherjs@latest # Or replace 'latest' with another version.
4242
```
4343

4444
If your local Go distribution as reported by `go version` is newer than Go 1.18, then you need to set the `GOPHERJS_GOROOT` environment variable to a directory that contains a Go 1.18 distribution. For example:
4545

4646
```
47-
go get golang.org/dl/go1.18.1
48-
go1.18.1 download
49-
export GOPHERJS_GOROOT="$(go1.18.1 env GOROOT)" # Also add this line to your .profile or equivalent.
47+
go install golang.org/dl/go1.18.6@latest
48+
go1.18.6 download
49+
export GOPHERJS_GOROOT="$(go1.18.6 env GOROOT)" # Also add this line to your .profile or equivalent.
5050
```
5151

5252
Now you can use `gopherjs build [package]`, `gopherjs build [files]` or `gopherjs install [package]` which behave similar to the `go` tool. For `main` packages, these commands create a `.js` file and `.js.map` source map in the current directory or in `$GOPATH/bin`. The generated JavaScript file can be used as usual in a website. Use `gopherjs help [command]` to get a list of possible command line flags, e.g. for minification and automatically watching for changes.

0 commit comments

Comments
 (0)