Skip to content
This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Commit 8417bdc

Browse files
committed
Do not die when some env vars are specified
We ignore them anyway - our own set of env vars is passed to exec.Cmd.
1 parent b1b7c78 commit 8417bdc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

goaci.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ import (
2525

2626
var Debug bool
2727

28-
func die(s string, i ...interface{}) {
28+
func warn(s string, i ...interface{}) {
2929
s = fmt.Sprintf(s, i...)
3030
fmt.Fprintln(os.Stderr, strings.TrimSuffix(s, "\n"))
31+
}
32+
33+
func die(s string, i ...interface{}) {
34+
warn(s, i...)
3135
os.Exit(1)
3236
}
3337

@@ -68,10 +72,10 @@ func main() {
6872
flag.StringVar(&goBinaryOpt, "go-binary", gocmd, goDefaultBinaryDesc)
6973
flag.Parse()
7074
if os.Getenv("GOPATH") != "" {
71-
die("to avoid confusion GOPATH must not be set")
75+
warn("GOPATH envvar is ignored")
7276
}
7377
if os.Getenv("GOROOT") != "" {
74-
die("to avoid confusion GOROOT must not be set, use --go-binary=\"$GOROOT/bin/go\" option instead")
78+
warn("GOROOT envvar is ignored, use --go-binary=\"$GOROOT/bin/go\" option instead")
7579
}
7680
if os.Getenv("GOACI_DEBUG") != "" {
7781
Debug = true

0 commit comments

Comments
 (0)