1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:10:21 -07:00

math,net: omit explicit true tag expr in switch

Performed `switch true {}` => `switch {}` replacement.

Found using https://go-critic.github.io/overview.html#switchTrue-ref

Change-Id: Ib39ea98531651966a5a56b7bd729b46e4eeb7f7c
Reviewed-on: https://go-review.googlesource.com/123378
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Iskander Sharipov 2018-07-11 23:42:40 +03:00 committed by Brad Fitzpatrick
parent 328adf9d62
commit 0fbaf6ca8b
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ func sinh(x float64) float64 {
}
var temp float64
switch true {
switch {
case x > 21:
temp = Exp(x) * 0.5

View File

@ -222,7 +222,7 @@ func (ip IP) DefaultMask() IPMask {
if ip = ip.To4(); ip == nil {
return nil
}
switch true {
switch {
case ip[0] < 0x80:
return classAMask
case ip[0] < 0xC0: