diff --git a/enumerator/usb_js.go b/enumerator/usb_js.go new file mode 100644 index 0000000..3f3b22f --- /dev/null +++ b/enumerator/usb_js.go @@ -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{} +} diff --git a/enumerator/usb_wasm.go b/enumerator/usb_wasm.go new file mode 100644 index 0000000..24d79ff --- /dev/null +++ b/enumerator/usb_wasm.go @@ -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{} +} diff --git a/enumerator_js.go b/enumerator_js.go new file mode 100644 index 0000000..9fa0441 --- /dev/null +++ b/enumerator_js.go @@ -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") +} diff --git a/enumerator_wasm.go b/enumerator_wasm.go new file mode 100644 index 0000000..560ba1b --- /dev/null +++ b/enumerator_wasm.go @@ -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") +} diff --git a/serial_js.go b/serial_js.go new file mode 100644 index 0000000..b20987f --- /dev/null +++ b/serial_js.go @@ -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") +} diff --git a/serial_wasm.go b/serial_wasm.go new file mode 100644 index 0000000..6dd694d --- /dev/null +++ b/serial_wasm.go @@ -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") +}