diff options
| author | Christine Dodrill <me@christine.website> | 2018-12-08 10:03:49 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2018-12-08 10:03:49 -0800 |
| commit | 93c1f99c4e29800126a08569e12d804e0de256cd (patch) | |
| tree | 13d10009cc3fc9d1398e0b7262f75d558fd31302 | |
| parent | dabf564f027b859e14836bfe7e46f6391c510a98 (diff) | |
| download | x-93c1f99c4e29800126a08569e12d804e0de256cd.tar.xz x-93c1f99c4e29800126a08569e12d804e0de256cd.zip | |
version/ko: be smarter
| -rw-r--r-- | version/ko/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/version/ko/main.go b/version/ko/main.go index a299bab..584ae4d 100644 --- a/version/ko/main.go +++ b/version/ko/main.go @@ -1,12 +1,22 @@ package main import ( + "log" "os" + "runtime" "github.com/Xe/x/version" _ "github.com/joho/godotenv/autoload" ) func main() { - version.Run(os.Getenv("GO_VERSION")) + ver := os.Getenv("GO_VERSION") + + if ver == "" { + log.Printf("ko: No GO_VERSION specified (wanted GO_VERSION=%[1]s) specified, assuming %[1]s", runtime.Version()) + } + + ver = "go" + ver + + version.Run(ver) } |
