Skip to content

Commit

Permalink
fix: hong kong is not in china
Browse files Browse the repository at this point in the history
a previous commit set this conditional to return as `true` when
the detected windows locale `zh-hk` is detected, and then applies
`GOPROXY` setting based on such detection.

the flag is supposed to _Set GOPROXY for people in China_. if this
flag is truthy, the proxy `goproxy.cn` is used, which would, in
effect, redirect HK users traffic.
  • Loading branch information
sgammon committed Jul 21, 2023
1 parent 74fdb39 commit c46d95f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/make.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func isInChinaWindows() bool {
return false
}
// Check if output contains `zh-cn;`
return strings.Contains(out, "zh-cn;") || strings.Contains(out, "zh-hk;")
return strings.Contains(out, "zh-cn;")
}

func isInChina() bool {
Expand All @@ -466,7 +466,7 @@ func isInChina() bool {
}
if strings.HasPrefix(out, prefix) {
out = out[len(prefix):]
return strings.HasPrefix(out, "zh_CN") || strings.HasPrefix(out, "zh_HK")
return strings.HasPrefix(out, "zh_CN")
}
return false
}
Expand Down

0 comments on commit c46d95f

Please sign in to comment.