Skip to content

Commit

Permalink
misc: make the value of environment variable G_EXPERIMENTAL case-inse…
Browse files Browse the repository at this point in the history
…nsitive
  • Loading branch information
voidint committed Nov 30, 2023
1 parent 196f870 commit 47c8b72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ func Version() string {
}
buf.WriteString(fmt.Sprintf("\n%-15s%s", "Go version:", runtime.Version()))
buf.WriteString(fmt.Sprintf("\n%-15s%s/%s", "Os/Arch:", runtime.GOOS, runtime.GOARCH))
buf.WriteString(fmt.Sprintf("\n%-15s%t", "Experimental:", os.Getenv("G_EXPERIMENTAL") == "true"))
buf.WriteString(fmt.Sprintf("\n%-15s%t", "Experimental:", strings.EqualFold(os.Getenv("G_EXPERIMENTAL"), "true")))
return buf.String()
}
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const (

// ghome 返回g根目录
func ghome() (dir string) {
if experimental := os.Getenv(experimentalEnv); experimental == "true" {
if experimental := os.Getenv(experimentalEnv); strings.EqualFold(experimental, "true") {
if dir = os.Getenv(homeEnv); dir != "" {
return dir
}
Expand Down

0 comments on commit 47c8b72

Please sign in to comment.