diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 01e32d5c8..27e65c4da 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -115,8 +115,9 @@ jobs: run: go mod tidy && git diff --exit-code - name: Check natives build tags working-directory: ${{ env.GOPHERJS_PATH }} - # All those packages should have // +build js. - run: diff -u <(echo -n) <(go list ./compiler/natives/src/...) + run: | + echo "Any following packages have at least one file that is missing //go:build js" + diff -u <(echo -n) <(go list ./compiler/natives/src/...) go_tests: name: Go Tests diff --git a/compiler/gopherjspkg/fs.go b/compiler/gopherjspkg/fs.go index 0ec155308..caa07e11c 100644 --- a/compiler/gopherjspkg/fs.go +++ b/compiler/gopherjspkg/fs.go @@ -1,8 +1,6 @@ package gopherjspkg -import ( - "net/http" -) +import "net/http" // FS is a virtual filesystem that contains core GopherJS packages. var FS http.FileSystem diff --git a/compiler/natives/src/bufio/bufio_test.go b/compiler/natives/src/bufio/bufio_test.go index b97fe22f7..f0ddf0534 100644 --- a/compiler/natives/src/bufio/bufio_test.go +++ b/compiler/natives/src/bufio/bufio_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bufio_test diff --git a/compiler/natives/src/bytes/bytes.go b/compiler/natives/src/bytes/bytes.go index 1f74edc4f..15c014301 100644 --- a/compiler/natives/src/bytes/bytes.go +++ b/compiler/natives/src/bytes/bytes.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bytes diff --git a/compiler/natives/src/bytes/bytes_test.go b/compiler/natives/src/bytes/bytes_test.go index e9d0e1690..5a2277f59 100644 --- a/compiler/natives/src/bytes/bytes_test.go +++ b/compiler/natives/src/bytes/bytes_test.go @@ -1,11 +1,8 @@ //go:build js -// +build js package bytes_test -import ( - "testing" -) +import "testing" func dangerousSlice(t *testing.T) []byte { t.Skip("dangerousSlice relies on syscall.Getpagesize, which GopherJS doesn't implement") diff --git a/compiler/natives/src/compress/gzip/example_test.go b/compiler/natives/src/compress/gzip/example_test.go index b3f6fbe43..37b3e734c 100644 --- a/compiler/natives/src/compress/gzip/example_test.go +++ b/compiler/natives/src/compress/gzip/example_test.go @@ -1,11 +1,8 @@ //go:build js && wasm -// +build js,wasm package gzip_test -import ( - "fmt" -) +import "fmt" // The test relies on a local HTTP server, which is not supported under NodeJS. func Example_compressingReader() { diff --git a/compiler/natives/src/crypto/elliptic/nistec.go b/compiler/natives/src/crypto/elliptic/nistec.go index 326c602d5..b2cc45e9d 100644 --- a/compiler/natives/src/crypto/elliptic/nistec.go +++ b/compiler/natives/src/crypto/elliptic/nistec.go @@ -1,5 +1,4 @@ //go:build js -// +build js package elliptic diff --git a/compiler/natives/src/crypto/internal/boring/bbig/big.go b/compiler/natives/src/crypto/internal/boring/bbig/big.go index 3a726ba3c..170a6f983 100644 --- a/compiler/natives/src/crypto/internal/boring/bbig/big.go +++ b/compiler/natives/src/crypto/internal/boring/bbig/big.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bbig diff --git a/compiler/natives/src/crypto/internal/boring/bcache/cache.go b/compiler/natives/src/crypto/internal/boring/bcache/cache.go index afff404ce..b33233211 100644 --- a/compiler/natives/src/crypto/internal/boring/bcache/cache.go +++ b/compiler/natives/src/crypto/internal/boring/bcache/cache.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bcache diff --git a/compiler/natives/src/crypto/internal/boring/bcache/cache_test.go b/compiler/natives/src/crypto/internal/boring/bcache/cache_test.go index 12f2c4da4..9f50eb0ff 100644 --- a/compiler/natives/src/crypto/internal/boring/bcache/cache_test.go +++ b/compiler/natives/src/crypto/internal/boring/bcache/cache_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bcache diff --git a/compiler/natives/src/crypto/internal/boring/sig/sig.go b/compiler/natives/src/crypto/internal/boring/sig/sig.go index 3eb2454aa..dab01104e 100644 --- a/compiler/natives/src/crypto/internal/boring/sig/sig.go +++ b/compiler/natives/src/crypto/internal/boring/sig/sig.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sig diff --git a/compiler/natives/src/crypto/internal/nistec/nistec_test.go b/compiler/natives/src/crypto/internal/nistec/nistec_test.go index d755e7ec3..4da8ba9e3 100644 --- a/compiler/natives/src/crypto/internal/nistec/nistec_test.go +++ b/compiler/natives/src/crypto/internal/nistec/nistec_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package nistec_test diff --git a/compiler/natives/src/crypto/internal/nistec/wrapper.go b/compiler/natives/src/crypto/internal/nistec/wrapper.go index 0d6706b52..a55aa4925 100644 --- a/compiler/natives/src/crypto/internal/nistec/wrapper.go +++ b/compiler/natives/src/crypto/internal/nistec/wrapper.go @@ -1,5 +1,4 @@ //go:build js -// +build js package nistec diff --git a/compiler/natives/src/crypto/internal/subtle/aliasing.go b/compiler/natives/src/crypto/internal/subtle/aliasing.go index 145687d59..23c9843c8 100644 --- a/compiler/natives/src/crypto/internal/subtle/aliasing.go +++ b/compiler/natives/src/crypto/internal/subtle/aliasing.go @@ -1,5 +1,4 @@ //go:build js -// +build js package subtle diff --git a/compiler/natives/src/crypto/rand/rand.go b/compiler/natives/src/crypto/rand/rand.go index 1c3631a02..4e4aab565 100644 --- a/compiler/natives/src/crypto/rand/rand.go +++ b/compiler/natives/src/crypto/rand/rand.go @@ -1,5 +1,4 @@ //go:build js -// +build js package rand diff --git a/compiler/natives/src/database/sql/driver/driver_test.go b/compiler/natives/src/database/sql/driver/driver_test.go index 446da47c5..59ac867ef 100644 --- a/compiler/natives/src/database/sql/driver/driver_test.go +++ b/compiler/natives/src/database/sql/driver/driver_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package driver @@ -24,10 +23,10 @@ var valueConverterTests = []valueConverterTest{ {DefaultParameterConverter, (*int64)(nil), nil, ""}, {DefaultParameterConverter, &answer, answer, ""}, {DefaultParameterConverter, &now, now, ""}, - //{DefaultParameterConverter, i(9), int64(9), ""}, // TODO: Fix. + //{DefaultParameterConverter, i(9), int64(9), ""}, // TODO: Fix. Errors with `driver.defaultConverter(driver.i(9)) = 9 (driver.i); want 9 (int64)` {DefaultParameterConverter, f(0.1), float64(0.1), ""}, {DefaultParameterConverter, b(true), true, ""}, - //{DefaultParameterConverter, bs{1}, []byte{1}, ""}, // TODO: Fix. + //{DefaultParameterConverter, bs{1}, []byte{1}, ""}, // TODO: Fix. Errors with `driver.defaultConverter(driver.bs([1])) = [1] (driver.bs); want [1] ([]uint8)` {DefaultParameterConverter, s("a"), "a", ""}, {DefaultParameterConverter, is{1}, nil, "unsupported type driver.is, a slice of int"}, } diff --git a/compiler/natives/src/debug/pe/symbol.go b/compiler/natives/src/debug/pe/symbol.go index 798502ce3..7564b8f77 100644 --- a/compiler/natives/src/debug/pe/symbol.go +++ b/compiler/natives/src/debug/pe/symbol.go @@ -1,5 +1,4 @@ //go:build js -// +build js package pe diff --git a/compiler/natives/src/embed/embed.go b/compiler/natives/src/embed/embed.go index bb9738546..83cf729ac 100644 --- a/compiler/natives/src/embed/embed.go +++ b/compiler/natives/src/embed/embed.go @@ -1,5 +1,4 @@ //go:build js -// +build js package embed diff --git a/compiler/natives/src/encoding/gob/gob_test.go b/compiler/natives/src/encoding/gob/gob_test.go index 823b572ac..32cd38bbd 100644 --- a/compiler/natives/src/encoding/gob/gob_test.go +++ b/compiler/natives/src/encoding/gob/gob_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package gob @@ -105,3 +104,7 @@ func TestTypeRace(t *testing.T) { // cannot succeed when nosync is used. t.Skip("using nosync") } + +func TestCountDecodeMallocs(t *testing.T) { + t.Skip("testing.AllocsPerRun not supported in GopherJS") +} diff --git a/compiler/natives/src/encoding/json/stream_test.go b/compiler/natives/src/encoding/json/stream_test.go index adad8e153..484ee5c12 100644 --- a/compiler/natives/src/encoding/json/stream_test.go +++ b/compiler/natives/src/encoding/json/stream_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package json diff --git a/compiler/natives/src/fmt/fmt_test.go b/compiler/natives/src/fmt/fmt_test.go index 70797693b..1a1c3278c 100644 --- a/compiler/natives/src/fmt/fmt_test.go +++ b/compiler/natives/src/fmt/fmt_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package fmt_test diff --git a/compiler/natives/src/go/parser/parser_test.go b/compiler/natives/src/go/parser/parser_test.go index 7fded29fd..00f533233 100644 --- a/compiler/natives/src/go/parser/parser_test.go +++ b/compiler/natives/src/go/parser/parser_test.go @@ -2,9 +2,7 @@ package parser -import ( - "testing" -) +import "testing" func TestParseDepthLimit(t *testing.T) { t.Skip("causes call stack exhaustion on js/ecmascript") diff --git a/compiler/natives/src/go/token/position.go b/compiler/natives/src/go/token/position.go index 6a1ee0c15..8cf111ab2 100644 --- a/compiler/natives/src/go/token/position.go +++ b/compiler/natives/src/go/token/position.go @@ -1,5 +1,4 @@ //go:build js -// +build js package token diff --git a/compiler/natives/src/go/token/token_test.go b/compiler/natives/src/go/token/token_test.go index 335ee0776..9ef38348a 100644 --- a/compiler/natives/src/go/token/token_test.go +++ b/compiler/natives/src/go/token/token_test.go @@ -1,12 +1,9 @@ //go:build js -// +build js package token -import ( - "testing" -) +import "testing" func TestFileSetRace(t *testing.T) { - t.Skip() + t.Skip("Fails with: WaitGroup counter not zero") } diff --git a/compiler/natives/src/golang.org/x/crypto/internal/alias/alias.go b/compiler/natives/src/golang.org/x/crypto/internal/alias/alias.go index a3e1e7f79..9b168a95a 100644 --- a/compiler/natives/src/golang.org/x/crypto/internal/alias/alias.go +++ b/compiler/natives/src/golang.org/x/crypto/internal/alias/alias.go @@ -1,5 +1,4 @@ //go:build js -// +build js package alias diff --git a/compiler/natives/src/golang.org/x/crypto/internal/subtle/aliasing.go b/compiler/natives/src/golang.org/x/crypto/internal/subtle/aliasing.go index 145687d59..23c9843c8 100644 --- a/compiler/natives/src/golang.org/x/crypto/internal/subtle/aliasing.go +++ b/compiler/natives/src/golang.org/x/crypto/internal/subtle/aliasing.go @@ -1,5 +1,4 @@ //go:build js -// +build js package subtle diff --git a/compiler/natives/src/hash/maphash/maphash.go b/compiler/natives/src/hash/maphash/maphash.go index 5c982404f..7c2a68cf6 100644 --- a/compiler/natives/src/hash/maphash/maphash.go +++ b/compiler/natives/src/hash/maphash/maphash.go @@ -1,11 +1,8 @@ //go:build js -// +build js package maphash -import ( - _ "unsafe" // for linkname -) +import _ "unsafe" // for linkname // hashkey is similar how it is defined in runtime/alg.go for Go 1.19 // to be used in hash{32,64}.go to seed the hash function as part of diff --git a/compiler/natives/src/hash/maphash/maphash_test.go b/compiler/natives/src/hash/maphash/maphash_test.go new file mode 100644 index 000000000..a1e9f45a9 --- /dev/null +++ b/compiler/natives/src/hash/maphash/maphash_test.go @@ -0,0 +1,53 @@ +//go:build js + +package maphash + +import "testing" + +//gopherjs:keep-original +func TestSmhasherSmallKeys(t *testing.T) { + if !testing.Short() { + t.Skip("Causes a heap overflow in GopherJS when not --short") + // This test adds a lot of uint64 hashes into a map, + // (16,843,008 for long tests, 65,792 for short tests) + // inside `(s *hashSet) add(h uint64)` with `s.m[h] = struct{}{}`. + // This is to check the number of collisions in the hash function. + } + _gopherjs_original_TestSmhasherSmallKeys(t) +} + +//gopherjs:keep-original +func TestSmhasherZeros(t *testing.T) { + if !testing.Short() { + t.Skip("Too slow when not --short") + // This test creates a byte slice with 262,144 bytes for long tests + // and 1,024 for short tests filled by defualt with zeroes. + // Then it adds [:1], [:2], and so on upto the full slice. + } + _gopherjs_original_TestSmhasherZeros(t) +} + +func TestSmhasherTwoNonzero(t *testing.T) { + // The original skips if `runtime.GOARCH == "wasm"` which means we should skip too. + t.Skip("Too slow on wasm and JS") +} + +func TestSmhasherSparse(t *testing.T) { + // The original skips if `runtime.GOARCH == "wasm"` which means we should skip too. + t.Skip("Too slow on wasm and JS") +} + +func TestSmhasherPermutation(t *testing.T) { + // The original skips if `runtime.GOARCH == "wasm"` which means we should skip too. + t.Skip("Too slow on wasm and JS") +} + +func TestSmhasherAvalanche(t *testing.T) { + // The original skips if `runtime.GOARCH == "wasm"` which means we should skip too. + t.Skip("Too slow on wasm and JS") +} + +func TestSmhasherWindowed(t *testing.T) { + // The original skips if `runtime.GOARCH == "wasm"` which means we should skip too. + t.Skip("Too slow on wasm and JS") +} diff --git a/compiler/natives/src/internal/bytealg/bytealg.go b/compiler/natives/src/internal/bytealg/bytealg.go index dbcc6dec4..15a3c2d70 100644 --- a/compiler/natives/src/internal/bytealg/bytealg.go +++ b/compiler/natives/src/internal/bytealg/bytealg.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bytealg diff --git a/compiler/natives/src/internal/cpu/cpu.go b/compiler/natives/src/internal/cpu/cpu.go index 794a58d6a..a8c25ea8e 100644 --- a/compiler/natives/src/internal/cpu/cpu.go +++ b/compiler/natives/src/internal/cpu/cpu.go @@ -1,5 +1,4 @@ //go:build js -// +build js package cpu diff --git a/compiler/natives/src/internal/fmtsort/fmtsort_test.go b/compiler/natives/src/internal/fmtsort/fmtsort_test.go index f45987d72..50b65bb45 100644 --- a/compiler/natives/src/internal/fmtsort/fmtsort_test.go +++ b/compiler/natives/src/internal/fmtsort/fmtsort_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package fmtsort_test diff --git a/compiler/natives/src/internal/poll/semaphore.go b/compiler/natives/src/internal/poll/semaphore.go index 5e4f5ea8d..112a37768 100644 --- a/compiler/natives/src/internal/poll/semaphore.go +++ b/compiler/natives/src/internal/poll/semaphore.go @@ -1,11 +1,8 @@ //go:build js -// +build js package poll -import ( - _ "unsafe" // For go:linkname -) +import _ "unsafe" // For go:linkname //go:linkname runtime_Semacquire sync.runtime_Semacquire func runtime_Semacquire(s *uint32) diff --git a/compiler/natives/src/internal/reflectlite/all_test.go b/compiler/natives/src/internal/reflectlite/all_test.go index 4445189a0..66a7add0a 100644 --- a/compiler/natives/src/internal/reflectlite/all_test.go +++ b/compiler/natives/src/internal/reflectlite/all_test.go @@ -1,27 +1,7 @@ //go:build js -// +build js package reflectlite_test -import ( - "testing" - - . "internal/reflectlite" -) - -func TestTypes(t *testing.T) { - for i, tt := range typeTests { - if i == 30 { - continue - } - testReflectType(t, i, Field(ValueOf(tt.i), 0).Type(), tt.s) - } -} - -func TestNameBytesAreAligned(t *testing.T) { - t.Skip("TestNameBytesAreAligned") -} - // `A` is used with `B[T any]` and is otherwise not needed. // //gopherjs:purge for go1.19 without generics diff --git a/compiler/natives/src/internal/reflectlite/export_test.go b/compiler/natives/src/internal/reflectlite/export_test.go index d663e65ba..c80ba65a8 100644 --- a/compiler/natives/src/internal/reflectlite/export_test.go +++ b/compiler/natives/src/internal/reflectlite/export_test.go @@ -1,11 +1,8 @@ //go:build js -// +build js package reflectlite -import ( - "unsafe" -) +import "unsafe" // Field returns the i'th field of the struct v. // It panics if v's Kind is not Struct or i is out of range. diff --git a/compiler/natives/src/internal/reflectlite/reflect_mirror_test.go b/compiler/natives/src/internal/reflectlite/reflect_mirror_test.go deleted file mode 100644 index 01504f582..000000000 --- a/compiler/natives/src/internal/reflectlite/reflect_mirror_test.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build js -// +build js - -package reflectlite_test - -import ( - "testing" -) - -func TestMirrorWithReflect(t *testing.T) { - t.Skip("TestMirrorWithReflect") -} diff --git a/compiler/natives/src/internal/reflectlite/reflectlite.go b/compiler/natives/src/internal/reflectlite/reflectlite.go index d48f15987..f55eb4437 100644 --- a/compiler/natives/src/internal/reflectlite/reflectlite.go +++ b/compiler/natives/src/internal/reflectlite/reflectlite.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflectlite diff --git a/compiler/natives/src/internal/reflectlite/swapper.go b/compiler/natives/src/internal/reflectlite/swapper.go index b8827c226..b324eb6e7 100644 --- a/compiler/natives/src/internal/reflectlite/swapper.go +++ b/compiler/natives/src/internal/reflectlite/swapper.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflectlite diff --git a/compiler/natives/src/internal/reflectlite/type.go b/compiler/natives/src/internal/reflectlite/type.go index 0a41e862e..949599725 100644 --- a/compiler/natives/src/internal/reflectlite/type.go +++ b/compiler/natives/src/internal/reflectlite/type.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflectlite diff --git a/compiler/natives/src/internal/reflectlite/utils.go b/compiler/natives/src/internal/reflectlite/utils.go index 1941f0d0e..c832bd4cf 100644 --- a/compiler/natives/src/internal/reflectlite/utils.go +++ b/compiler/natives/src/internal/reflectlite/utils.go @@ -1,11 +1,8 @@ //go:build js -// +build js package reflectlite -import ( - "unsafe" -) +import "unsafe" type ChanDir int diff --git a/compiler/natives/src/internal/reflectlite/value.go b/compiler/natives/src/internal/reflectlite/value.go index 32d310723..12f8d292f 100644 --- a/compiler/natives/src/internal/reflectlite/value.go +++ b/compiler/natives/src/internal/reflectlite/value.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflectlite diff --git a/compiler/natives/src/internal/unsafeheader/unsafeheader_test.go b/compiler/natives/src/internal/unsafeheader/unsafeheader_test.go index f20cf31fa..abe54639b 100644 --- a/compiler/natives/src/internal/unsafeheader/unsafeheader_test.go +++ b/compiler/natives/src/internal/unsafeheader/unsafeheader_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package unsafeheader_test diff --git a/compiler/natives/src/io/io_test.go b/compiler/natives/src/io/io_test.go index d746b3709..36d70e3fa 100644 --- a/compiler/natives/src/io/io_test.go +++ b/compiler/natives/src/io/io_test.go @@ -1,14 +1,11 @@ //go:build js -// +build js package io_test -import ( - "testing" -) +import "testing" func TestMultiWriter_WriteStringSingleAlloc(t *testing.T) { - t.Skip() + t.Skip("testing.AllocsPerRun not supported in GopherJS") } func TestMultiReaderFreesExhaustedReaders(t *testing.T) { diff --git a/compiler/natives/src/math/big/big.go b/compiler/natives/src/math/big/big.go deleted file mode 100644 index 25512db31..000000000 --- a/compiler/natives/src/math/big/big.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build js -// +build js - -package big - -// TODO: This is a workaround for https://github.com/gopherjs/gopherjs/issues/652. -// -// Remove after that issue is resolved. -type Word uintptr diff --git a/compiler/natives/src/math/big/big_test.go b/compiler/natives/src/math/big/big_test.go index acad9a043..92989abe9 100644 --- a/compiler/natives/src/math/big/big_test.go +++ b/compiler/natives/src/math/big/big_test.go @@ -1,18 +1,9 @@ //go:build js -// +build js package big import "testing" -func TestBytes(t *testing.T) { - t.Skip("broken") -} - -func TestModSqrt(t *testing.T) { - t.Skip("slow") -} - func TestLinkerGC(t *testing.T) { t.Skip("The test is specific to GC's linker.") } diff --git a/compiler/natives/src/math/bits/bits.go b/compiler/natives/src/math/bits/bits.go index b434603a4..cf4b66df6 100644 --- a/compiler/natives/src/math/bits/bits.go +++ b/compiler/natives/src/math/bits/bits.go @@ -1,5 +1,4 @@ //go:build js -// +build js package bits diff --git a/compiler/natives/src/math/math.go b/compiler/natives/src/math/math.go index b0ed2da0d..fb0777b12 100644 --- a/compiler/natives/src/math/math.go +++ b/compiler/natives/src/math/math.go @@ -1,11 +1,8 @@ //go:build js -// +build js package math -import ( - "github.com/gopherjs/gopherjs/js" -) +import "github.com/gopherjs/gopherjs/js" var ( math = js.Global.Get("Math") diff --git a/compiler/natives/src/math/math_test.go b/compiler/natives/src/math/math_test.go deleted file mode 100644 index eb62dd1d1..000000000 --- a/compiler/natives/src/math/math_test.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build js -// +build js - -package math_test - -import ( - "testing" -) - -// Slightly higher tolerances than upstream, otherwise TestGamma fails. -// TODO: Is there a better way to fix TestGamma? It's weird that only one test -// -// requires increasing tolerances. Perhaps there's a better fix? Maybe we -// should override TestGamma specifically and not the package-wide tolerances, -// because this will cause many other tests to be less accurate. Or maybe this -// is fine? -func close(a, b float64) bool { return tolerance(a, b, 4e-14) } -func veryclose(a, b float64) bool { return tolerance(a, b, 6e-15) } - -func testExp(t *testing.T, Exp func(float64) float64, name string) { - t.Skip("inaccurate") -} diff --git a/compiler/natives/src/math/rand/rand_test.go b/compiler/natives/src/math/rand/rand_test.go index 2246dfec4..0073850a0 100644 --- a/compiler/natives/src/math/rand/rand_test.go +++ b/compiler/natives/src/math/rand/rand_test.go @@ -1,14 +1,9 @@ //go:build js -// +build js package rand_test import "testing" -func TestFloat32(t *testing.T) { - t.Skip("slow") -} - func TestConcurrent(t *testing.T) { t.Skip("using nosync") } diff --git a/compiler/natives/src/net/fastrand.go b/compiler/natives/src/net/fastrand.go index 8feafc78f..878f970a5 100644 --- a/compiler/natives/src/net/fastrand.go +++ b/compiler/natives/src/net/fastrand.go @@ -1,11 +1,8 @@ //go:build js -// +build js package net -import ( - _ "unsafe" // For go:linkname -) +import _ "unsafe" // For go:linkname //go:linkname fastrandu runtime.fastrandu func fastrandu() uint diff --git a/compiler/natives/src/net/http/client_test.go b/compiler/natives/src/net/http/client_test.go index 302b800df..f8c3b744e 100644 --- a/compiler/natives/src/net/http/client_test.go +++ b/compiler/natives/src/net/http/client_test.go @@ -2,9 +2,7 @@ package http_test -import ( - "testing" -) +import "testing" func testClientTimeout(t *testing.T, h2 bool) { // The original test expects Client.Timeout error to be returned, but under diff --git a/compiler/natives/src/net/http/clientserver_test.go b/compiler/natives/src/net/http/clientserver_test.go index 35b44dd4d..a95a5a0ca 100644 --- a/compiler/natives/src/net/http/clientserver_test.go +++ b/compiler/natives/src/net/http/clientserver_test.go @@ -1,16 +1,14 @@ //go:build js && wasm -// +build js,wasm package http_test -import ( - "testing" -) +import "testing" func testTransportGCRequest(t *testing.T, h2, body bool) { t.Skip("The test relies on runtime.SetFinalizer(), which is not supported by GopherJS.") } func testWriteHeaderAfterWrite(t *testing.T, h2, hijack bool) { + // See: https://github.com/gopherjs/gopherjs/issues/1085 t.Skip("GopherJS source maps don't preserve original function names in stack traces, which this test relied on.") } diff --git a/compiler/natives/src/net/http/cookiejar/example_test.go b/compiler/natives/src/net/http/cookiejar/example_test.go index 09de5d0cf..7171867c1 100644 --- a/compiler/natives/src/net/http/cookiejar/example_test.go +++ b/compiler/natives/src/net/http/cookiejar/example_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package cookiejar_test diff --git a/compiler/natives/src/net/http/http.go b/compiler/natives/src/net/http/http.go index 8fd607c4d..fbd7a8927 100644 --- a/compiler/natives/src/net/http/http.go +++ b/compiler/natives/src/net/http/http.go @@ -1,5 +1,4 @@ //go:build js -// +build js package http diff --git a/compiler/natives/src/net/http/http_wasm_test.go b/compiler/natives/src/net/http/http_wasm_test.go index d078c0ea3..4c10efd9a 100644 --- a/compiler/natives/src/net/http/http_wasm_test.go +++ b/compiler/natives/src/net/http/http_wasm_test.go @@ -1,5 +1,4 @@ //go:build js && wasm -// +build js,wasm package http diff --git a/compiler/natives/src/net/http/main_test.go b/compiler/natives/src/net/http/main_test.go index bb747d123..2b2e3ec32 100644 --- a/compiler/natives/src/net/http/main_test.go +++ b/compiler/natives/src/net/http/main_test.go @@ -1,5 +1,4 @@ //go:build js && wasm -// +build js,wasm package http_test diff --git a/compiler/natives/src/net/http/server_test.go b/compiler/natives/src/net/http/server_test.go index f55704dcf..7223713d9 100644 --- a/compiler/natives/src/net/http/server_test.go +++ b/compiler/natives/src/net/http/server_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package http_test @@ -8,3 +7,8 @@ import "testing" func TestTimeoutHandlerSuperfluousLogs(t *testing.T) { t.Skip("https://github.com/gopherjs/gopherjs/issues/1085") } + +func TestHTTP2WriteDeadlineExtendedOnNewRequest(t *testing.T) { + // Test depends on httptest.NewUnstartedServer + t.Skip("Network access not supported by GopherJS.") +} diff --git a/compiler/natives/src/net/http/transport_test.go b/compiler/natives/src/net/http/transport_test.go index a173e47e7..2ece96853 100644 --- a/compiler/natives/src/net/http/transport_test.go +++ b/compiler/natives/src/net/http/transport_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package http_test diff --git a/compiler/natives/src/net/netip/export_test.go b/compiler/natives/src/net/netip/export_test.go index 03b7cbe1b..fca2dc07c 100644 --- a/compiler/natives/src/net/netip/export_test.go +++ b/compiler/natives/src/net/netip/export_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package netip diff --git a/compiler/natives/src/net/netip/fuzz_test.go b/compiler/natives/src/net/netip/fuzz_test.go index f7359c5bb..574201d2d 100644 --- a/compiler/natives/src/net/netip/fuzz_test.go +++ b/compiler/natives/src/net/netip/fuzz_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package netip_test diff --git a/compiler/natives/src/net/netip/netip.go b/compiler/natives/src/net/netip/netip.go index 9d2b8b2d6..61b40fc24 100644 --- a/compiler/natives/src/net/netip/netip.go +++ b/compiler/natives/src/net/netip/netip.go @@ -1,5 +1,4 @@ //go:build js -// +build js package netip diff --git a/compiler/natives/src/net/netip/netip_test.go b/compiler/natives/src/net/netip/netip_test.go index 46b116c00..280929425 100644 --- a/compiler/natives/src/net/netip/netip_test.go +++ b/compiler/natives/src/net/netip/netip_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package netip_test diff --git a/compiler/natives/src/os/file.go b/compiler/natives/src/os/file.go index a3683b8b0..2df42121a 100644 --- a/compiler/natives/src/os/file.go +++ b/compiler/natives/src/os/file.go @@ -1,5 +1,4 @@ //go:build js -// +build js package os diff --git a/compiler/natives/src/os/os.go b/compiler/natives/src/os/os.go index a45e13508..103ccb288 100644 --- a/compiler/natives/src/os/os.go +++ b/compiler/natives/src/os/os.go @@ -1,5 +1,4 @@ //go:build js -// +build js package os diff --git a/compiler/natives/src/os/signal/signal.go b/compiler/natives/src/os/signal/signal.go index fe38d22b2..b39453926 100644 --- a/compiler/natives/src/os/signal/signal.go +++ b/compiler/natives/src/os/signal/signal.go @@ -1,5 +1,4 @@ //go:build js -// +build js package signal diff --git a/compiler/natives/src/reflect/example_test.go b/compiler/natives/src/reflect/example_test.go index 0deab2ed5..65abf3dd6 100644 --- a/compiler/natives/src/reflect/example_test.go +++ b/compiler/natives/src/reflect/example_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflect_test diff --git a/compiler/natives/src/reflect/reflect.go b/compiler/natives/src/reflect/reflect.go index 81f4c7b08..f1f24e559 100644 --- a/compiler/natives/src/reflect/reflect.go +++ b/compiler/natives/src/reflect/reflect.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflect diff --git a/compiler/natives/src/reflect/reflect_test.go b/compiler/natives/src/reflect/reflect_test.go index 4c0bcd0be..9fb413c65 100644 --- a/compiler/natives/src/reflect/reflect_test.go +++ b/compiler/natives/src/reflect/reflect_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflect_test diff --git a/compiler/natives/src/reflect/swapper.go b/compiler/natives/src/reflect/swapper.go index 068f984ed..d951ff668 100644 --- a/compiler/natives/src/reflect/swapper.go +++ b/compiler/natives/src/reflect/swapper.go @@ -1,5 +1,4 @@ //go:build js -// +build js package reflect diff --git a/compiler/natives/src/regexp/regexp_test.go b/compiler/natives/src/regexp/regexp_test.go index 3a2d58d32..471281fa1 100644 --- a/compiler/natives/src/regexp/regexp_test.go +++ b/compiler/natives/src/regexp/regexp_test.go @@ -1,11 +1,8 @@ //go:build js -// +build js package regexp -import ( - "testing" -) +import "testing" //gopherjs:keep-original func TestOnePassCutoff(t *testing.T) { diff --git a/compiler/natives/src/runtime/debug/debug.go b/compiler/natives/src/runtime/debug/debug.go index b45da62bb..ed9c0e34f 100644 --- a/compiler/natives/src/runtime/debug/debug.go +++ b/compiler/natives/src/runtime/debug/debug.go @@ -1,8 +1,9 @@ //go:build js -// +build js package debug +import "time" + func setGCPercent(int32) int32 { // Not implemented. Return initial setting. return 100 @@ -13,3 +14,26 @@ func setMaxStack(bytes int) int { // The initial setting is 1 GB on 64-bit systems, 250 MB on 32-bit systems. return 250000000 } + +func readGCStats(pauses *[]time.Duration) { + // Not implemented. No GC stats available in this environment. +} + +func freeOSMemory() { + // Not implemented. No OS memory management in this environment. +} + +func setPanicOnFault(bool) bool { + // Not implemented. + return true +} + +func setMaxThreads(int) int { + // Not implemented. + return 10000 +} + +func setMemoryLimit(int64) int64 { + // Not implemented. + return 0 +} diff --git a/compiler/natives/src/runtime/debug/debug_test.go b/compiler/natives/src/runtime/debug/debug_test.go new file mode 100644 index 000000000..7c7bf855f --- /dev/null +++ b/compiler/natives/src/runtime/debug/debug_test.go @@ -0,0 +1,13 @@ +//go:build js + +package debug_test + +import "testing" + +func TestReadGCStats(t *testing.T) { + t.Skip(`This test uses runtime.GC(), which GopherJS doesn't support`) +} + +func TestFreeOSMemory(t *testing.T) { + t.Skip(`This test uses runtime.GC(), which GopherJS doesn't support`) +} diff --git a/compiler/natives/src/runtime/fastrand.go b/compiler/natives/src/runtime/fastrand.go index a5f2bdbb8..b902a5177 100644 --- a/compiler/natives/src/runtime/fastrand.go +++ b/compiler/natives/src/runtime/fastrand.go @@ -1,5 +1,4 @@ //go:build js -// +build js package runtime diff --git a/compiler/natives/src/runtime/pprof/pprof.go b/compiler/natives/src/runtime/pprof/pprof.go index f398ca21b..512ef1a5b 100644 --- a/compiler/natives/src/runtime/pprof/pprof.go +++ b/compiler/natives/src/runtime/pprof/pprof.go @@ -1,5 +1,4 @@ //go:build js -// +build js package pprof diff --git a/compiler/natives/src/runtime/runtime.go b/compiler/natives/src/runtime/runtime.go index 9f8425af8..56846b018 100644 --- a/compiler/natives/src/runtime/runtime.go +++ b/compiler/natives/src/runtime/runtime.go @@ -1,11 +1,8 @@ //go:build js -// +build js package runtime -import ( - "github.com/gopherjs/gopherjs/js" -) +import "github.com/gopherjs/gopherjs/js" const ( GOOS = "js" diff --git a/compiler/natives/src/strconv/atoi.go b/compiler/natives/src/strconv/atoi.go index 63ea9b732..1f26293a3 100644 --- a/compiler/natives/src/strconv/atoi.go +++ b/compiler/natives/src/strconv/atoi.go @@ -1,11 +1,8 @@ //go:build js -// +build js package strconv -import ( - "github.com/gopherjs/gopherjs/js" -) +import "github.com/gopherjs/gopherjs/js" const ( maxInt32 float64 = 1<<31 - 1 diff --git a/compiler/natives/src/strconv/itoa.go b/compiler/natives/src/strconv/itoa.go index c5440c78e..04dac0b71 100644 --- a/compiler/natives/src/strconv/itoa.go +++ b/compiler/natives/src/strconv/itoa.go @@ -1,11 +1,8 @@ //go:build js -// +build js package strconv -import ( - "github.com/gopherjs/gopherjs/js" -) +import "github.com/gopherjs/gopherjs/js" // Itoa in gopherjs is always a 32bit int so the native toString // always handles it successfully. diff --git a/compiler/natives/src/strings/strings.go b/compiler/natives/src/strings/strings.go index 2867872f6..6d8bedd54 100644 --- a/compiler/natives/src/strings/strings.go +++ b/compiler/natives/src/strings/strings.go @@ -1,5 +1,4 @@ //go:build js -// +build js package strings diff --git a/compiler/natives/src/strings/strings_test.go b/compiler/natives/src/strings/strings_test.go index fb9a4a57a..adc05d6c5 100644 --- a/compiler/natives/src/strings/strings_test.go +++ b/compiler/natives/src/strings/strings_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package strings_test diff --git a/compiler/natives/src/sync/atomic/atomic.go b/compiler/natives/src/sync/atomic/atomic.go index 1cbfe65f9..99aa8559f 100644 --- a/compiler/natives/src/sync/atomic/atomic.go +++ b/compiler/natives/src/sync/atomic/atomic.go @@ -1,5 +1,4 @@ //go:build js -// +build js package atomic diff --git a/compiler/natives/src/sync/atomic/atomic_test.go b/compiler/natives/src/sync/atomic/atomic_test.go index e1ec6086c..8dbd0d027 100644 --- a/compiler/natives/src/sync/atomic/atomic_test.go +++ b/compiler/natives/src/sync/atomic/atomic_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package atomic_test diff --git a/compiler/natives/src/sync/cond.go b/compiler/natives/src/sync/cond.go index 916ace8f7..1f94d5284 100644 --- a/compiler/natives/src/sync/cond.go +++ b/compiler/natives/src/sync/cond.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync diff --git a/compiler/natives/src/sync/cond_test.go b/compiler/natives/src/sync/cond_test.go index 3b286ba49..e530b9625 100644 --- a/compiler/natives/src/sync/cond_test.go +++ b/compiler/natives/src/sync/cond_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync_test diff --git a/compiler/natives/src/sync/map_test.go b/compiler/natives/src/sync/map_test.go index 432096071..5e8460411 100644 --- a/compiler/natives/src/sync/map_test.go +++ b/compiler/natives/src/sync/map_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync_test diff --git a/compiler/natives/src/sync/pool.go b/compiler/natives/src/sync/pool.go index 9d3825e14..c865ca5dc 100644 --- a/compiler/natives/src/sync/pool.go +++ b/compiler/natives/src/sync/pool.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync diff --git a/compiler/natives/src/sync/pool_test.go b/compiler/natives/src/sync/pool_test.go index ea35fd136..09ab79b32 100644 --- a/compiler/natives/src/sync/pool_test.go +++ b/compiler/natives/src/sync/pool_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync_test diff --git a/compiler/natives/src/sync/sync.go b/compiler/natives/src/sync/sync.go index 294b0b109..5ca82694e 100644 --- a/compiler/natives/src/sync/sync.go +++ b/compiler/natives/src/sync/sync.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync diff --git a/compiler/natives/src/sync/waitgroup.go b/compiler/natives/src/sync/waitgroup.go index e1f20eeb6..99cb49ff7 100644 --- a/compiler/natives/src/sync/waitgroup.go +++ b/compiler/natives/src/sync/waitgroup.go @@ -1,5 +1,4 @@ //go:build js -// +build js package sync diff --git a/compiler/natives/src/syscall/fs_js.go b/compiler/natives/src/syscall/fs_js.go index 5a0a5a64d..23c2b2145 100644 --- a/compiler/natives/src/syscall/fs_js.go +++ b/compiler/natives/src/syscall/fs_js.go @@ -2,9 +2,7 @@ package syscall -import ( - "syscall/js" -) +import "syscall/js" // fsCall emulates a file system-related syscall via a corresponding NodeJS fs // API. diff --git a/compiler/natives/src/syscall/js/export_test.go b/compiler/natives/src/syscall/js/export_test.go index 8f030c4d7..fb133a150 100644 --- a/compiler/natives/src/syscall/js/export_test.go +++ b/compiler/natives/src/syscall/js/export_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package js diff --git a/compiler/natives/src/syscall/js/js.go b/compiler/natives/src/syscall/js/js.go index c0c18a614..03a09fde8 100644 --- a/compiler/natives/src/syscall/js/js.go +++ b/compiler/natives/src/syscall/js/js.go @@ -1,5 +1,4 @@ //go:build js -// +build js package js diff --git a/compiler/natives/src/syscall/js/js_test.go b/compiler/natives/src/syscall/js/js_test.go index 999266da2..4c6e091df 100644 --- a/compiler/natives/src/syscall/js/js_test.go +++ b/compiler/natives/src/syscall/js/js_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package js_test diff --git a/compiler/natives/src/syscall/legacy.go b/compiler/natives/src/syscall/legacy.go index beb99eb78..ad1df8bda 100644 --- a/compiler/natives/src/syscall/legacy.go +++ b/compiler/natives/src/syscall/legacy.go @@ -2,9 +2,7 @@ package syscall -import ( - "github.com/gopherjs/gopherjs/js" -) +import "github.com/gopherjs/gopherjs/js" var ( syscallModule *js.Object diff --git a/compiler/natives/src/syscall/syscall_js_wasm.go b/compiler/natives/src/syscall/syscall_js_wasm.go index 5bcbdeed4..648c228cb 100644 --- a/compiler/natives/src/syscall/syscall_js_wasm.go +++ b/compiler/natives/src/syscall/syscall_js_wasm.go @@ -1,8 +1,6 @@ package syscall -import ( - "syscall/js" -) +import "syscall/js" func runtime_envs() []string { process := js.Global().Get("process") diff --git a/compiler/natives/src/testing/allocs_test.go b/compiler/natives/src/testing/allocs_test.go index 54c2f545b..e1f4cffba 100644 --- a/compiler/natives/src/testing/allocs_test.go +++ b/compiler/natives/src/testing/allocs_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package testing_test diff --git a/compiler/natives/src/testing/example.go b/compiler/natives/src/testing/example.go index bf8d06482..8568fec2c 100644 --- a/compiler/natives/src/testing/example.go +++ b/compiler/natives/src/testing/example.go @@ -1,5 +1,4 @@ //go:build js -// +build js package testing diff --git a/compiler/natives/src/testing/helper_test.go b/compiler/natives/src/testing/helper_test.go index 6815fd651..3615da315 100644 --- a/compiler/natives/src/testing/helper_test.go +++ b/compiler/natives/src/testing/helper_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package testing diff --git a/compiler/natives/src/testing/helperfuncs_test.go b/compiler/natives/src/testing/helperfuncs_test.go index 54a1ee737..560c0466a 100644 --- a/compiler/natives/src/testing/helperfuncs_test.go +++ b/compiler/natives/src/testing/helperfuncs_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package testing diff --git a/compiler/natives/src/testing/quick/quick.go b/compiler/natives/src/testing/quick/quick.go index 51fa843aa..bd9bccf3e 100644 --- a/compiler/natives/src/testing/quick/quick.go +++ b/compiler/natives/src/testing/quick/quick.go @@ -13,12 +13,11 @@ var maxCountCap int = 0 // reasonable amount of time. This is a better compromise than disabling a slow // test entirely. // -// //gopherjs:keep-original -// func TestFoo(t *testing.T) { -// t.Cleanup(quick.GopherJSInternalMaxCountCap(100)) -// _gopherjs_original_TestFoo(t) -// } - +// //gopherjs:keep-original +// func TestFoo(t *testing.T) { +// t.Cleanup(quick.GopherJSInternalMaxCountCap(100)) +// _gopherjs_original_TestFoo(t) +// } func GopherJSInternalMaxCountCap(newCap int) (restore func()) { previousCap := maxCountCap maxCountCap = newCap diff --git a/compiler/natives/src/testing/sub_test.go b/compiler/natives/src/testing/sub_test.go index 1e9a79e47..300045db3 100644 --- a/compiler/natives/src/testing/sub_test.go +++ b/compiler/natives/src/testing/sub_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package testing diff --git a/compiler/natives/src/text/template/template.go b/compiler/natives/src/text/template/template.go index 056fe9c85..d5cf5de56 100644 --- a/compiler/natives/src/text/template/template.go +++ b/compiler/natives/src/text/template/template.go @@ -1,5 +1,4 @@ //go:build js -// +build js package template diff --git a/compiler/natives/src/time/time.go b/compiler/natives/src/time/time.go index 40c596e68..3b0cb0ef4 100644 --- a/compiler/natives/src/time/time.go +++ b/compiler/natives/src/time/time.go @@ -1,5 +1,4 @@ //go:build js -// +build js package time diff --git a/compiler/natives/src/time/time_test.go b/compiler/natives/src/time/time_test.go index 5d4119cc6..777fe11fe 100644 --- a/compiler/natives/src/time/time_test.go +++ b/compiler/natives/src/time/time_test.go @@ -1,16 +1,13 @@ //go:build js -// +build js package time_test -import ( - "testing" -) +import "testing" -func TestSleep(t *testing.T) { - t.Skip("time.Now() is not accurate enough for the test") +func TestZeroTimer(t *testing.T) { + t.Skip(`This test is very slow (about 19 mins)`) } -func TestEnvTZUsage(t *testing.T) { - t.Skip("TZ environment variable in not applicable in the browser context.") +func TestSleep(t *testing.T) { + t.Skip("time.Now() is not accurate enough for the test") } diff --git a/compiler/natives/src/time/zoneinfo_js.go b/compiler/natives/src/time/zoneinfo_js.go index 0101b95f9..2932b9cf0 100644 --- a/compiler/natives/src/time/zoneinfo_js.go +++ b/compiler/natives/src/time/zoneinfo_js.go @@ -1,5 +1,4 @@ //go:build js -// +build js package time diff --git a/compiler/natives/src/time/zoneinfo_unix_test.go b/compiler/natives/src/time/zoneinfo_unix_test.go new file mode 100644 index 000000000..8cb20416e --- /dev/null +++ b/compiler/natives/src/time/zoneinfo_unix_test.go @@ -0,0 +1,9 @@ +//go:build js && unix && !ios && !android + +package time_test + +import "testing" + +func TestEnvTZUsage(t *testing.T) { + t.Skip("TZ environment variable in not applicable in the browser context.") +} diff --git a/compiler/natives/src/unicode/unicode.go b/compiler/natives/src/unicode/unicode.go index a622c32f1..806f72bdb 100644 --- a/compiler/natives/src/unicode/unicode.go +++ b/compiler/natives/src/unicode/unicode.go @@ -1,5 +1,4 @@ //go:build js -// +build js package unicode diff --git a/compiler/natives/src/vendor/golang.org/x/crypto/internal/subtle/aliasing.go b/compiler/natives/src/vendor/golang.org/x/crypto/internal/subtle/aliasing.go index 104ac82bb..0b515aeee 100644 --- a/compiler/natives/src/vendor/golang.org/x/crypto/internal/subtle/aliasing.go +++ b/compiler/natives/src/vendor/golang.org/x/crypto/internal/subtle/aliasing.go @@ -1,5 +1,4 @@ //go:build js -// +build js package subtle diff --git a/internal/sysutil/sysutil.go b/internal/sysutil/sysutil.go index e19eb02e1..8fc72403d 100644 --- a/internal/sysutil/sysutil.go +++ b/internal/sysutil/sysutil.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows // Package sysutil contains system-specific utilities. package sysutil diff --git a/js/js_test.go b/js/js_test.go index d7a904954..53fee6473 100644 --- a/js/js_test.go +++ b/js/js_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package js_test diff --git a/tests/alias_test.go b/tests/alias_test.go index 9e791856e..ecd911d9d 100644 --- a/tests/alias_test.go +++ b/tests/alias_test.go @@ -1,8 +1,6 @@ package tests -import ( - "testing" -) +import "testing" type foo struct { a int diff --git a/tests/compiler_test.go b/tests/compiler_test.go index 7c72e3535..e33d24efe 100644 --- a/tests/compiler_test.go +++ b/tests/compiler_test.go @@ -1,8 +1,6 @@ package tests -import ( - "testing" -) +import "testing" func TestVariadicNil(t *testing.T) { t.Run("only variadic", func(t *testing.T) { diff --git a/tests/gorepo/run.go b/tests/gorepo/run.go index 3685e99d6..0cb3b8143 100644 --- a/tests/gorepo/run.go +++ b/tests/gorepo/run.go @@ -1,5 +1,4 @@ //go:build ignore -// +build ignore // skip diff --git a/tests/js_test.go b/tests/js_test.go index 6f6eaa542..bed64179c 100644 --- a/tests/js_test.go +++ b/tests/js_test.go @@ -1,5 +1,4 @@ //go:build js && !wasm -// +build js,!wasm package tests_test diff --git a/tests/map_js_test.go b/tests/map_js_test.go index c815661ab..04847d3d4 100644 --- a/tests/map_js_test.go +++ b/tests/map_js_test.go @@ -1,5 +1,4 @@ //go:build js && !wasm -// +build js,!wasm package tests diff --git a/tests/syscall_test.go b/tests/syscall_test.go index 104800df7..ea880a218 100644 --- a/tests/syscall_test.go +++ b/tests/syscall_test.go @@ -1,5 +1,4 @@ //go:build js -// +build js package tests diff --git a/tests/testdata/legacy_syscall/main.go b/tests/testdata/legacy_syscall/main.go index 75ba22f6b..359d737af 100644 --- a/tests/testdata/legacy_syscall/main.go +++ b/tests/testdata/legacy_syscall/main.go @@ -1,5 +1,4 @@ //go:build legacy_syscall && gopherjs -// +build legacy_syscall,gopherjs // This program tests GopherJS's ability to perform raw syscalls using the // deprecated node_syscall extension. See TestLegacySyscall.