From 0fbaf6ca8b4939fbac8081f28aad12a0305afa35 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Wed, 11 Jul 2018 23:42:40 +0300 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/math/sinh.go | 2 +- src/net/ip.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/sinh.go b/src/math/sinh.go index 39e7c2047a..573a37e35f 100644 --- a/src/math/sinh.go +++ b/src/math/sinh.go @@ -43,7 +43,7 @@ func sinh(x float64) float64 { } var temp float64 - switch true { + switch { case x > 21: temp = Exp(x) * 0.5 diff --git a/src/net/ip.go b/src/net/ip.go index da8dca588e..410de92ccc 100644 --- a/src/net/ip.go +++ b/src/net/ip.go @@ -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: -- 2.50.0