Adds support for build on GOOS=js (#1614)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2023-08-07 14:59:12 +09:00
committed by GitHub
parent edb7bc2b10
commit 2922b0e63c
4 changed files with 13 additions and 9 deletions

View File

@@ -214,6 +214,8 @@ check:
#
# Ensure we build on plan9. See #1578
@GOARCH=amd64 GOOS=plan9 go build ./...
# Ensure we build on gojs. See #1526. TODO: add GOOS=wasi as well.
@GOARCH=wasm GOOS=js go build ./...
# Ensure we build on windows:
@GOARCH=amd64 GOOS=windows go build ./...
# Ensure we build on an arbitrary operating system:

View File

@@ -1,8 +0,0 @@
package sock
// plan9 doesn't declare these constants
const (
SHUT_RD = iota
SHUT_RDWR
SHUT_WR
)

View File

@@ -1,4 +1,4 @@
//go:build !plan9
//go:build !plan9 && !js
package sock

View File

@@ -0,0 +1,10 @@
//go:build plan9 || js
package sock
// plan9/js doesn't declare these constants
const (
SHUT_RD = 1 << iota
SHUT_WR
SHUT_RDWR = SHUT_RD | SHUT_WR
)