mirror of
https://github.com/golang/go
synced 2024-11-24 05:40:15 -07:00
runtime: simplify GOOS detection in mstart()
The existing condition is long and repetitive. Using select/case with multiple values in the expression list is more concise and clearer. Change-Id: I43f8abcf958e433468728f1d89ff1436332b29da Reviewed-on: https://go-review.googlesource.com/c/go/+/188519 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
4757518737
commit
b3a1205a11
@ -1167,7 +1167,8 @@ func mstart() {
|
|||||||
mstart1()
|
mstart1()
|
||||||
|
|
||||||
// Exit this thread.
|
// Exit this thread.
|
||||||
if GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "aix" {
|
switch GOOS {
|
||||||
|
case "windows", "solaris", "illumos", "plan9", "darwin", "aix":
|
||||||
// Windows, Solaris, illumos, Darwin, AIX and Plan 9 always system-allocate
|
// Windows, Solaris, illumos, Darwin, AIX and Plan 9 always system-allocate
|
||||||
// the stack, but put it in _g_.stack before mstart,
|
// the stack, but put it in _g_.stack before mstart,
|
||||||
// so the logic above hasn't set osStack yet.
|
// so the logic above hasn't set osStack yet.
|
||||||
|
Loading…
Reference in New Issue
Block a user