Skip to content

Commit 710fdb7

Browse files
Merge branch 'go1.19' of github.com:gopherjs/gopherjs into go1.19NativesUpdate
2 parents db5d7b3 + 95c01fa commit 710fdb7

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

build/build.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ func pruneImports(file *ast.File) {
475475
path, _ := strconv.Unquote(in.Path.Value)
476476
directivePrefix, hasPath := directiveImports[path]
477477
if hasPath && astutil.HasDirectivePrefix(file, directivePrefix) {
478+
// since the import is otherwise unused set the name to blank.
479+
in.Name = ast.NewIdent(`_`)
478480
delete(unused, name)
479481
if len(unused) == 0 {
480482
return

build/build_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,14 @@ func TestOverlayAugmentation(t *testing.T) {
396396
397397
//go:linkname runtimeNano runtime.nanotime
398398
func runtimeNano() int64`,
399-
noCodeChange: true,
399+
want: `import _ "unsafe"
400+
import "embed"
401+
402+
//go:embed hello.txt
403+
var eFile embed.FS
404+
405+
//go:linkname runtimeNano runtime.nanotime
406+
func runtimeNano() int64`,
400407
expInfo: map[string]overrideInfo{
401408
`eFile`: {},
402409
`runtimeNano`: {},

circle.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ parameters:
5555
go_version:
5656
type: string
5757
default: "1.19.13"
58+
chocolatey_go_version:
59+
type: string
60+
# Chocolatey doesn't have 1.19.13, closest is 1.19.9
61+
default: "1.19.9"
5862
nvm_version:
5963
type: string
6064
default: "0.38.0"
@@ -171,7 +175,7 @@ jobs:
171175
- run:
172176
name: Install Go
173177
command: |
174-
choco install golang --version="<< pipeline.parameters.go_version >>" -my
178+
choco install golang --version="<< pipeline.parameters.chocolatey_go_version >>" -my
175179
go version
176180
(Get-Command go).Path
177181
[Environment]::SetEnvironmentVariable(

tests/gorepo/run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,16 @@ var knownFails = map[string]failReason{
151151
// These are new tests in Go 1.18
152152
"fixedbugs/issue46938.go": {category: notApplicable, desc: "tests -d=checkptr compiler mode, which GopherJS doesn't support"},
153153
"fixedbugs/issue47928.go": {category: notApplicable, desc: "//go:nointerface is a part of GOEXPERIMENT=fieldtrack and is not supported by GopherJS"},
154-
"fixedbugs/issue49665.go": {category: other, desc: "attempts to pass -gcflags=-G=3 to enable generics, GopherJS doesn't expect the flag; re-enable in Go 1.19 where the flag is removed"},
155154
"fixedbugs/issue48898.go": {category: other, desc: "https://github.com/gopherjs/gopherjs/issues/1128"},
156155
"fixedbugs/issue48536.go": {category: usesUnsupportedPackage, desc: "https://github.com/gopherjs/gopherjs/issues/1130"},
157156
"fixedbugs/issue53600.go": {category: lowLevelRuntimeDifference, desc: "GopherJS println format is different from Go's"},
157+
158+
// These are new tests in Go 1.19
159+
"fixedbugs/issue50672.go": {category: usesUnsupportedGenerics, desc: "Checking function nesting with one function having a type parameter."},
160+
"fixedbugs/issue53137.go": {category: usesUnsupportedGenerics, desc: "Checking setting type parameter of struct in parameter of a generic function."},
161+
"fixedbugs/issue53309.go": {category: usesUnsupportedGenerics, desc: "Checking unused type parameter in method call to interface"},
162+
"fixedbugs/issue53635.go": {category: usesUnsupportedGenerics, desc: "Checking switch type against nil type with unsupported type parameters"},
163+
"fixedbugs/issue53653.go": {category: lowLevelRuntimeDifference, desc: "GopherJS println format of int64 is different from Go's"},
158164
}
159165

160166
type failCategory uint8
@@ -164,6 +170,7 @@ const (
164170
neverTerminates // Test never terminates (so avoid starting it).
165171
usesUnsupportedPackage // Test fails because it imports an unsupported package, e.g., "unsafe".
166172
requiresSourceMapSupport // Test fails without source map support (as configured in CI), because it tries to check filename/line number via runtime.Caller.
173+
usesUnsupportedGenerics // Test uses generics (type parameters) that are not currently supported.
167174
compilerPanic
168175
unsureIfGopherJSSupportsThisFeature
169176
lowLevelRuntimeDifference // JavaScript runtime behaves differently from Go in ways that are difficult to work around.

0 commit comments

Comments
 (0)