Black Lives Matter. Support the Equal Justice Initiative.

Source file src/os/exec/lp_js.go

Documentation: os/exec

     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  
     5  //go:build js && wasm
     6  // +build js,wasm
     7  
     8  package exec
     9  
    10  import (
    11  	"errors"
    12  )
    13  
    14  // ErrNotFound is the error resulting if a path search failed to find an executable file.
    15  var ErrNotFound = errors.New("executable file not found in $PATH")
    16  
    17  // LookPath searches for an executable named file in the
    18  // directories named by the PATH environment variable.
    19  // If file contains a slash, it is tried directly and the PATH is not consulted.
    20  // The result may be an absolute path or a path relative to the current directory.
    21  func LookPath(file string) (string, error) {
    22  	// Wasm can not execute processes, so act as if there are no executables at all.
    23  	return "", &Error{file, ErrNotFound}
    24  }
    25  

View as plain text