no value of type uint32 is less than 0
59 b.ResetTimer()
60 b.RunParallel(func(pb *testing.PB) {
61 for pb.Next() {
62 if u := LimitedUint32(100); u < 0 { 63 b.Errorf("LimitedUint32(100) returns invalid value: %d", u)
64 }
65 }
no value of type uint32 is less than 0
103 b.ResetTimer()
104 b.RunParallel(func(pb *testing.PB) {
105 for pb.Next() {
106 if u := r.Uint32(); u < 0 {107 b.Errorf("r.Uint32() returns invalid value: %d", u)
108 }
109 }
no value of type uint32 is less than 0
135 b.ResetTimer()
136 b.RunParallel(func(pb *testing.PB) {
137 for pb.Next() {
138 if u := r.Uint32(); u < 0 {139 b.Errorf("r.Uint32() returns invalid value: %d", u)
140 }
141 }
no value of type uint32 is less than 0
35 b.ResetTimer()
36 b.RunParallel(func(pb *testing.PB) {
37 for pb.Next() {
38 if u := LimitedUint32(0); u < 0 { 39 b.Errorf("LimitedUint32(0) returns invalid value: %d", u)
40 }
41 }
no value of type uint32 is less than 0
87 b.ResetTimer()
88 b.RunParallel(func(pb *testing.PB) {
89 for pb.Next() {
90 if u := r.Uint32(); u < 0 { 91 b.Errorf("r.Uint32() returns invalid value: %d", u)
92 }
93 }
no value of type uint32 is less than 0
71 b.ResetTimer()
72 b.RunParallel(func(pb *testing.PB) {
73 for pb.Next() {
74 if u := LimitedUint32(math.MaxUint32); u < 0 { 75 b.Errorf("LimitedUint32(math.MaxUint32) returns invalid value: %d", u)
76 }
77 }
no value of type uint32 is less than 0
47 b.ResetTimer()
48 b.RunParallel(func(pb *testing.PB) {
49 for pb.Next() {
50 if u := LimitedUint32(10); u < 0 { 51 b.Errorf("LimitedUint32(10) returns invalid value: %d", u)
52 }
53 }
no value of type uint32 is less than 0
23 b.ResetTimer()
24 b.RunParallel(func(pb *testing.PB) {
25 for pb.Next() {
26 if u := Uint32(); u < 0 { 27 b.Errorf("Uint32() returns invalid value: %d", u)
28 }
29 }
no value of type uint32 is less than 0
119 b.ResetTimer()
120 b.RunParallel(func(pb *testing.PB) {
121 for pb.Next() {
122 if u := r.Uint32(); u < 0 {123 b.Errorf("r.Uint32() returns invalid value: %d", u)
124 }
125 }
Description
Comparing unsigned values against negative values is pointless. This expression will always be true, because unsigned integers will never be less than zero.