mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
To prepare for a smooth merge in the runner codebase. - run with --fix for gofumpt and golangci - manual edits for - disabling useless package naming warning - rename variables that had underscore in their name - remove trailing else at the end of a few functions Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/206 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
17 lines
270 B
Go
17 lines
270 B
Go
package lookpath
|
|
|
|
import "os"
|
|
|
|
type Env interface {
|
|
Getenv(name string) string
|
|
}
|
|
|
|
type defaultEnv struct{}
|
|
|
|
func (*defaultEnv) Getenv(name string) string {
|
|
return os.Getenv(name)
|
|
}
|
|
|
|
func LookPath(file string) (string, error) {
|
|
return LookPath2(file, &defaultEnv{})
|
|
}
|