fix: add shims for GOARCH=wasm with GOOS=js and GOOS=wasip1
Fixes build errors: GOOS=js GOARCH=wasm go build GOOS=wasip1 GOARCH=wasm go build Signed-off-by: Christian Stewart <christian@aperture.us>
This commit is contained in:
11
enumerator/usb_wasm.go
Normal file
11
enumerator/usb_wasm.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
//
|
||||||
|
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
|
||||||
|
package enumerator
|
||||||
|
|
||||||
|
func nativeGetDetailedPortsList() ([]*PortDetails, error) {
|
||||||
|
return nil, &PortEnumerationError{}
|
||||||
|
}
|
||||||
15
enumerator_wasm.go
Normal file
15
enumerator_wasm.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
|
||||||
|
package serial
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
func nativeGetPortsList() ([]string, error) {
|
||||||
|
return nil, errors.New("nativeGetPortsList is not supported on wasm")
|
||||||
|
}
|
||||||
15
serial_wasm.go
Normal file
15
serial_wasm.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
//
|
||||||
|
// Copyright 2014-2024 Cristian Maglie. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
//
|
||||||
|
|
||||||
|
package serial
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
func nativeOpen(portName string, mode *Mode) (Port, error) {
|
||||||
|
return nil, errors.New("nativeOpen is not supported on wasm")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user