Source file src/os/exec/lp_wasm.go

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

View as plain text