2022-11-16 22:29:45 +01:00
|
|
|
package lookpath
|
|
|
|
|
|
|
|
|
|
import "os"
|
|
|
|
|
|
|
|
|
|
type Env interface {
|
|
|
|
|
Getenv(name string) string
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-28 12:26:41 +00:00
|
|
|
type defaultEnv struct{}
|
2022-11-16 22:29:45 +01:00
|
|
|
|
|
|
|
|
func (*defaultEnv) Getenv(name string) string {
|
|
|
|
|
return os.Getenv(name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func LookPath(file string) (string, error) {
|
|
|
|
|
return LookPath2(file, &defaultEnv{})
|
|
|
|
|
}
|