xcaddy/internal/utils/environment.go
Peter Magnusson 7abc7f5752
Do not use only hardcoded "go" (#97)
* fix: do not use only hardcoded "go"

* fixed comments and added env to readme

* move GetGo to an internal package

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2022-04-25 10:13:12 -06:00

14 lines
243 B
Go

package utils
import "os"
// GetGo returns the go executable to use depending on what
// is set in the XCADDY_WHICH_GO environment variable.
func GetGo() string {
g := os.Getenv("XCADDY_WHICH_GO")
if g == "" {
return "go"
}
return g
}