diff options
| author | Richard Musiol <mail@richard-musiol.de> | 2018-03-04 12:16:18 +0100 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-06-01 05:18:38 +0000 |
| commit | 063f97a6110079c2aaeb5f2c2a51d7f1bc7445ab (patch) | |
| tree | 1d47e463e065280a53539ce838a9c97b271a3b31 /src/os/exec | |
| parent | a7e0a920ad45482183783c56e4dd39c9457ff4cc (diff) | |
| download | go-063f97a6110079c2aaeb5f2c2a51d7f1bc7445ab.tar.xz | |
os: add js/wasm architecture
This commit adds the js/wasm architecture to the os package.
Access to the actual file system is supported through Node.js.
Updates #18892
Change-Id: I6fa642fb294ca020b2c545649d4324d981aa0408
Reviewed-on: https://go-review.googlesource.com/109977
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/os/exec')
| -rw-r--r-- | src/os/exec/lp_js.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/os/exec/lp_js.go b/src/os/exec/lp_js.go new file mode 100644 index 0000000000..6750fb99b0 --- /dev/null +++ b/src/os/exec/lp_js.go @@ -0,0 +1,23 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build js,wasm + +package exec + +import ( + "errors" +) + +// ErrNotFound is the error resulting if a path search failed to find an executable file. +var ErrNotFound = errors.New("executable file not found in $PATH") + +// LookPath searches for an executable named file in the +// directories named by the PATH environment variable. +// If file contains a slash, it is tried directly and the PATH is not consulted. +// The result may be an absolute path or a path relative to the current directory. +func LookPath(file string) (string, error) { + // Wasm can not execute processes, so act as if there are no executables at all. + return "", &Error{file, ErrNotFound} +} |
