-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// 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. | ||
// | ||
|
||
//go:build wasip1 | ||
// +build wasip1 | ||
|
||
package enumerator | ||
|
||
func nativeGetDetailedPortsList() ([]*PortDetails, error) { | ||
return nil, &PortEnumerationError{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build js | ||
// +build js | ||
|
||
package serial | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
func nativeGetPortsList() ([]string, error) { | ||
return nil, errors.New("nativeGetPortsList is not supported on GOOS=js") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build wasip1 | ||
// +build wasip1 | ||
|
||
package serial | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
func nativeGetPortsList() ([]string, error) { | ||
return nil, errors.New("nativeGetPortsList is not supported on GOARCH=wasm") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build js | ||
// +build js | ||
|
||
package serial | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
func nativeOpen(portName string, mode *Mode) (Port, error) { | ||
return nil, errors.New("nativeOpen is not supported on GOOS=js") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build wasip1 | ||
// +build wasip1 | ||
|
||
package serial | ||
|
||
import ( | ||
"errors" | ||
) | ||
|
||
func nativeOpen(portName string, mode *Mode) (Port, error) { | ||
return nil, errors.New("nativeOpen is not supported on GOARCH=wasm") | ||
} |