Skip to content

Commit

Permalink
Merge pull request #176 from paralin/fix-wasm
Browse files Browse the repository at this point in the history
fix: add shims for GOARCH=wasm with GOOS=js and GOOS=wasip1
  • Loading branch information
cmaglie authored Mar 11, 2024
2 parents 259bdeb + 42bc112 commit 0925f99
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
11 changes: 11 additions & 0 deletions enumerator/usb_wasm.go
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{}
}
15 changes: 15 additions & 0 deletions enumerator_wasm.go
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions serial_wasm.go
Original file line number Diff line number Diff line change
@@ -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")
}

0 comments on commit 0925f99

Please sign in to comment.