Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f63887

Browse files
Merge pull request #1399 from Workiva/touchup120
Touchup of go1.20
2 parents 33de2a5 + 1d47769 commit 2f63887

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/measure-size.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: ['pull_request']
44

55
env:
66
GO_VERSION: '~1.20.14'
7-
GOPHERJS_EXPERIMENT: generics
87

98
jobs:
109
measure:

build/context.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,18 @@ func (cc chainedCtx) Import(importPath string, srcDir string, mode build.ImportM
368368
pkg, err := cc.primary.Import(importPath, srcDir, mode)
369369
if err == nil {
370370
return pkg, nil
371-
} else if IsPkgNotFound(err) {
372-
return cc.secondary.Import(importPath, srcDir, mode)
373-
} else {
374-
return nil, err
375371
}
372+
373+
if IsPkgNotFound(err) {
374+
if pkg, err2 := cc.secondary.Import(importPath, srcDir, mode); err2 == nil {
375+
return pkg, nil
376+
}
377+
// if err2 != nil, return the original error that occurred in primary
378+
// context since the secondary is for the virtual gopherjs context,
379+
// meaning err2 will say that GOPATH is not set which is misleading.
380+
}
381+
382+
return nil, err
376383
}
377384

378385
func (cc chainedCtx) Env() Env { return cc.primary.Env() }

compiler/natives/src/crypto/subtle/xor.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func XORBytes(dst, x, y []byte) int {
1818
panic("subtle.XORBytes: dst too short")
1919
}
2020

21-
// The original uses unsafe and uintptr for specific architecture
21+
// GOPHERJS: The original uses unsafe and uintptr for specific architecture
2222
// to pack registers full instead of doing one byte at a time.
2323
// We can't do the unsafe conversions from []byte to []uintptr
2424
// but we can convert a Uint8Array into a Uint32Array,
@@ -73,7 +73,5 @@ const supportsUnaligned = false
7373
//gopherjs:purge
7474
func xorBytes(dstb, xb, yb *byte, n int)
7575

76-
// TODO(grantnelson-wf): Check if this should be removed or not with generics.
77-
//
7876
//gopherjs:purge
7977
func xorLoop[T byte | uintptr](dst, x, y []T) {}

0 commit comments

Comments
 (0)