From: Ayan George Date: Thu, 1 Aug 2019 16:35:59 +0000 (-0400) Subject: runtime: simplify GOOS detection in mstart() X-Git-Tag: go1.14beta1~1300 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b3a1205a1133328068f002dd44141cb9efb2127b;p=gostls13.git 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 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index df98783385..72e6f0da0c 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -1167,7 +1167,8 @@ func mstart() { mstart1() // 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 // the stack, but put it in _g_.stack before mstart, // so the logic above hasn't set osStack yet.