@@ -78,9 +78,9 @@ func TestParse(t *testing.T) {
7878 }
7979
8080 // Check ~4M YYYY-MM-DD dates in 20 byte form.
81- for year := 0 ; year <= 9999 ; year ++ {
82- for month := 0 ; month <= 13 ; month ++ {
83- for day := 0 ; day <= 32 ; day ++ {
81+ for year := range 10000 {
82+ for month := range 14 {
83+ for day := range 33 {
8484 input := fmt .Sprintf ("%04d-%02d-%02dT12:34:56Z" , year , month , day )
8585 expect , expectErr := time .Parse (time .RFC3339Nano , input )
8686 actual , actualErr := Parse (input )
@@ -94,9 +94,9 @@ func TestParse(t *testing.T) {
9494 }
9595
9696 // Check ~4M YYYY-MM-DD dates in 24 byte form.
97- for year := 0 ; year <= 9999 ; year ++ {
98- for month := 0 ; month <= 13 ; month ++ {
99- for day := 0 ; day <= 32 ; day ++ {
97+ for year := range 10000 {
98+ for month := range 14 {
99+ for day := range 33 {
100100 input := fmt .Sprintf ("%04d-%02d-%02dT12:34:56.789Z" , year , month , day )
101101 expect , expectErr := time .Parse (time .RFC3339Nano , input )
102102 actual , actualErr := Parse (input )
@@ -110,9 +110,9 @@ func TestParse(t *testing.T) {
110110 }
111111
112112 // Check ~4M YYYY-MM-DD dates in 30 byte form.
113- for year := 0 ; year <= 9999 ; year ++ {
114- for month := 0 ; month <= 13 ; month ++ {
115- for day := 0 ; day <= 32 ; day ++ {
113+ for year := range 10000 {
114+ for month := range 14 {
115+ for day := range 33 {
116116 input := fmt .Sprintf ("%04d-%02d-%02dT12:34:56.123456789Z" , year , month , day )
117117 expect , expectErr := time .Parse (time .RFC3339Nano , input )
118118 actual , actualErr := Parse (input )
@@ -126,9 +126,9 @@ func TestParse(t *testing.T) {
126126 }
127127
128128 // Check all ~1M HH:MM:SS times in 20 byte form.
129- for hour := 0 ; hour < 100 ; hour ++ {
130- for minute := 0 ; minute < 100 ; minute ++ {
131- for second := 0 ; second < 100 ; second ++ {
129+ for hour := range 100 {
130+ for minute := range 100 {
131+ for second := range 100 {
132132 input := fmt .Sprintf ("2000-01-01T%02d:%02d:%02dZ" , hour , minute , second )
133133 expect , expectErr := time .Parse (time .RFC3339Nano , input )
134134 actual , actualErr := Parse (input )
@@ -142,9 +142,9 @@ func TestParse(t *testing.T) {
142142 }
143143
144144 // Check ~1M HH:MM:SS.MMM times in 24 byte form.
145- for hour := 0 ; hour < 100 ; hour ++ {
146- for minute := 0 ; minute < 100 ; minute ++ {
147- for second := 0 ; second < 100 ; second ++ {
145+ for hour := range 100 {
146+ for minute := range 100 {
147+ for second := range 100 {
148148 input := fmt .Sprintf ("2000-01-01T%02d:%02d:%02d.123Z" , hour , minute , second )
149149 expect , expectErr := time .Parse (time .RFC3339Nano , input )
150150 actual , actualErr := Parse (input )
@@ -158,9 +158,9 @@ func TestParse(t *testing.T) {
158158 }
159159
160160 // Check ~1M HH:MM:SS.MMM times in 30 byte form.
161- for hour := 0 ; hour < 100 ; hour ++ {
162- for minute := 0 ; minute < 100 ; minute ++ {
163- for second := 0 ; second < 100 ; second ++ {
161+ for hour := range 100 {
162+ for minute := range 100 {
163+ for second := range 100 {
164164 input := fmt .Sprintf ("2000-01-01T%02d:%02d:%02d.123456789Z" , hour , minute , second )
165165 expect , expectErr := time .Parse (time .RFC3339Nano , input )
166166 actual , actualErr := Parse (input )
@@ -405,31 +405,31 @@ func TestParseInvalid(t *testing.T) {
405405}
406406
407407func BenchmarkParse (b * testing.B ) {
408- for i := 0 ; i < b .N ; i ++ {
408+ for range b .N {
409409 Parse ("2006-01-02T15:04:05Z" )
410410 }
411411}
412412
413413func BenchmarkParseMilliseconds (b * testing.B ) {
414- for i := 0 ; i < b .N ; i ++ {
414+ for range b .N {
415415 Parse ("2006-01-02T15:04:05.123Z" )
416416 }
417417}
418418
419419func BenchmarkParseMicroseconds (b * testing.B ) {
420- for i := 0 ; i < b .N ; i ++ {
420+ for range b .N {
421421 Parse ("2006-01-02T15:04:05.123456Z" )
422422 }
423423}
424424
425425func BenchmarkParseNanoseconds (b * testing.B ) {
426- for i := 0 ; i < b .N ; i ++ {
426+ for range b .N {
427427 Parse ("2006-01-02T15:04:05.123456789Z" )
428428 }
429429}
430430
431431func BenchmarkParseInvalid (b * testing.B ) {
432- for i := 0 ; i < b .N ; i ++ {
432+ for range b .N {
433433 Parse ("2006-01-02T15:04:05.XZ" )
434434 }
435435}
0 commit comments