what a rabbithole. lots of goodies now.
This commit is contained in:
8
internal/consts.go
Normal file
8
internal/consts.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package internal
|
||||
|
||||
// OS-specific path environment variable name. The default is "PATH".
|
||||
var (
|
||||
pathEnvVarName map[string]string = map[string]string{
|
||||
"windows": "Path",
|
||||
}
|
||||
)
|
||||
18
internal/utils.go
Normal file
18
internal/utils.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
`runtime`
|
||||
)
|
||||
|
||||
// GetPathEnvName gets the OS-specific path environment variable name.
|
||||
func GetPathEnvName() (envVarName string) {
|
||||
|
||||
var ok bool
|
||||
|
||||
if envVarName, ok = pathEnvVarName[runtime.GOOS]; !ok {
|
||||
// *NIX/the default.
|
||||
envVarName = "PATH"
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user