Skip to content

Commit 0fbaf6c

Browse files
Iskander Sharipovbradfitz
Iskander Sharipov
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 328adf9 commit 0fbaf6c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/math/sinh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func sinh(x float64) float64 {
4343
}
4444

4545
var temp float64
46-
switch true {
46+
switch {
4747
case x > 21:
4848
temp = Exp(x) * 0.5
4949

src/net/ip.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (ip IP) DefaultMask() IPMask {
222222
if ip = ip.To4(); ip == nil {
223223
return nil
224224
}
225-
switch true {
225+
switch {
226226
case ip[0] < 0x80:
227227
return classAMask
228228
case ip[0] < 0xC0:

0 commit comments

Comments
 (0)