github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/os/exec/lp_plan9.go (about)

     1  // Copyright 2011 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  package exec
     6  
     7  import (
     8  	"github.com/shogo82148/std/errors"
     9  )
    10  
    11  // ErrNotFoundは、パスの検索が実行可能なファイルを見つけられなかった場合のエラーです。
    12  var ErrNotFound = errors.New("executable file not found in $path")
    13  
    14  // LookPathは、path環境変数で指定されたディレクトリ内の実行可能なファイルを検索します。
    15  // もしファイルが "/", "#", "./", または "../" で始まる場合、直接試みられ、
    16  // パスは参照されません。
    17  // 成功すると、結果は絶対パスになります。
    18  //
    19  // Goの古いバージョンでは、LookPathは現在のディレクトリに対する相対パスを返すことができました。
    20  // Go 1.19以降では、LookPathはそのパスとともに、[errors.Is](err, [ErrDot])を満たすエラーを返します。
    21  // 詳細はパッケージのドキュメンテーションを参照してください。
    22  func LookPath(file string) (string, error)