Skip to content

[go1.20] Starting 1.20 updates #1273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: "1.19.13"
go-version: "1.20.14"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/measure-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: '~1.19.13'
go-version: '~1.20.14'
- uses: gopherjs/output-size-action/measure@main
with:
name: jQuery TodoMVC
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ Nearly everything, including Goroutines ([compatibility documentation](https://g

### Installation and Usage

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

Install GopherJS with `go install`:

```
go install github.com/gopherjs/gopherjs@v1.19.0-beta1 # Or replace 'v1.19.0-beta1' with another version.
go install github.com/gopherjs/gopherjs@v1.20.0-beta1 # Or replace 'v1.20.0-beta1' with another version.
```

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

```
go install golang.org/dl/go1.19.13@latest
go1.19.13 download
export GOPHERJS_GOROOT="$(go1.19.13 env GOROOT)" # Also add this line to your .profile or equivalent.
go install golang.org/dl/go1.20.14@latest
go1.20.14 download
export GOPHERJS_GOROOT="$(go1.20.14 env GOROOT)" # Also add this line to your .profile or equivalent.
```

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.
Expand Down
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ workflows:
parameters:
go_version:
type: string
default: "1.19.13"
default: "1.20.14"
chocolatey_go_version:
type: string
# Chocolatey doesn't have 1.19.13, closest is 1.19.9
default: "1.19.9"
# Chocolatey doesn't have 1.20.14, closest is 1.20.7
default: "1.20.7"
nvm_version:
type: string
default: "0.38.0"
Expand Down
8 changes: 4 additions & 4 deletions compiler/version_check.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build go1.19
//go:build go1.20

package compiler

Expand All @@ -12,10 +12,10 @@ import (
)

// Version is the GopherJS compiler version string.
const Version = "1.19.0-beta1+go1.19.13"
const Version = "1.20.0-beta1+go1.20.14"

// GoVersion is the current Go 1.x version that GopherJS is compatible with.
const GoVersion = 19
const GoVersion = 20

// CheckGoVersion checks the version of the Go distribution
// at goroot, and reports an error if it's not compatible
Expand Down Expand Up @@ -49,7 +49,7 @@ func goRootVersion(goroot string) (string, error) {
if err != nil {
return "", fmt.Errorf("`go version` command failed: %w", err)
}
// Expected output: go version go1.18.1 linux/amd64
// Expected output: go version go1.20.14 linux/amd64
parts := strings.Split(string(out), " ")
if len(parts) != 4 {
return "", fmt.Errorf("unexpected `go version` output %q, expected 4 words", string(out))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gopherjs/gopherjs

go 1.18
go 1.20

require (
github.com/evanw/esbuild v0.18.0
Expand Down