Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Update for go 1.14 Wasm changes #96

Merged
merged 2 commits into from
Oct 19, 2020
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
install:
# Manually download and install Go 1.13 instead of using gimme.
# It looks like gimme Go causes some errors on go-test for Wasm.
- wget -O go.tar.gz https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
- wget -O go.tar.gz https://dl.google.com/go/go1.15.3.linux-amd64.tar.gz
- tar -C ~ -xzf go.tar.gz
- rm go.tar.gz
- export GOROOT=~/go
Expand Down
6 changes: 3 additions & 3 deletions conn_browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,17 +272,17 @@ func arrayBufferToBytes(buffer js.Value) []byte {

func errorEventToError(val js.Value) error {
var typ string
if gotType := val.Get("type"); gotType != js.Undefined() {
if gotType := val.Get("type"); !gotType.Equal(js.Undefined()) {
typ = gotType.String()
} else {
typ = val.Type().String()
}
var reason string
if gotReason := val.Get("reason"); gotReason != js.Undefined() && gotReason.String() != "" {
if gotReason := val.Get("reason"); !gotReason.Equal(js.Undefined()) && gotReason.String() != "" {
reason = gotReason.String()
} else {
code := val.Get("code")
if code != js.Undefined() {
if !code.Equal(js.Undefined()) {
switch code := code.Int(); code {
case 1006:
reason = "code 1006: connection unexpectedly closed"
Expand Down