.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckExtremeComparison / CheckExtremeComparison.go
1 package pkg
2
3 import "math"
4
5 func fn1() {
6         var (
7                 u8  uint8
8                 u16 uint16
9                 u   uint
10
11                 i8  int8
12                 i16 int16
13                 i   int
14         )
15
16         _ = u8 > math.MaxUint8  // want `no value of type uint8 is greater than math\.MaxUint8`
17         _ = u8 >= math.MaxUint8 // want `no value of type uint8 is greater than math\.MaxUint8`
18         _ = u8 >= 0             // want `every value of type uint8 is >= 0`
19         _ = u8 <= math.MaxUint8 // want `every value of type uint8 is <= math\.MaxUint8`
20         _ = u8 > 0
21         _ = u8 >= 1
22         _ = u8 < math.MaxUint8
23         _ = u8 < 0 // want `no value of type uint8 is less than 0`
24         _ = u8 <= 0
25         _ = 0 > u8 // want `no value of type uint8 is less than 0`
26         _ = 0 >= u8
27
28         _ = u16 > math.MaxUint8
29         _ = u16 > math.MaxUint16 // want `no value of type uint16 is greater than math\.MaxUint16`
30         _ = u16 <= math.MaxUint8
31         _ = u16 <= math.MaxUint16 // want `every value of type uint16 is <= math\.MaxUint16`
32
33         _ = u > math.MaxUint32
34
35         _ = i8 > math.MaxInt8 // want `no value of type int8 is greater than math\.MaxInt8`
36         _ = i16 > math.MaxInt8
37         _ = i16 > math.MaxInt16 // want `no value of type int16 is greater than math\.MaxInt16`
38         _ = i > math.MaxInt32
39         _ = i8 < 0
40         _ = i8 <= math.MinInt8 // want `no value of type int8 is less than math\.MinInt8`
41         _ = i8 < math.MinInt8  // want `no value of type int8 is less than math\.MinInt8`
42         _ = i8 >= math.MinInt8 // want `every value of type int8 is >= math.MinInt8`
43 }