lp_js.go 820 B

1234567891011121314151617181920212223
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build js && wasm
  5. package exec
  6. import (
  7. "errors"
  8. )
  9. // ErrNotFound is the error resulting if a path search failed to find an executable file.
  10. var ErrNotFound = errors.New("executable file not found in $PATH")
  11. // LookPath searches for an executable named file in the
  12. // directories named by the PATH environment variable.
  13. // If file contains a slash, it is tried directly and the PATH is not consulted.
  14. // The result may be an absolute path or a path relative to the current directory.
  15. func LookPath(file string) (string, error) {
  16. // Wasm can not execute processes, so act as if there are no executables at all.
  17. return "", &Error{file, ErrNotFound}
  18. }