Skip to content

Commit d3feafb

Browse files
hanzeiblang
authored andcommitted
Explicitly ignore errors in benchmarks
1 parent 086cfa0 commit d3feafb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

range_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ func BenchmarkRangeParseSimple(b *testing.B) {
525525
b.ReportAllocs()
526526
b.ResetTimer()
527527
for n := 0; n < b.N; n++ {
528-
ParseRange(VERSION)
528+
_, _ = ParseRange(VERSION)
529529
}
530530
}
531531

@@ -534,7 +534,7 @@ func BenchmarkRangeParseAverage(b *testing.B) {
534534
b.ReportAllocs()
535535
b.ResetTimer()
536536
for n := 0; n < b.N; n++ {
537-
ParseRange(VERSION)
537+
_, _ = ParseRange(VERSION)
538538
}
539539
}
540540

@@ -543,7 +543,7 @@ func BenchmarkRangeParseComplex(b *testing.B) {
543543
b.ReportAllocs()
544544
b.ResetTimer()
545545
for n := 0; n < b.N; n++ {
546-
ParseRange(VERSION)
546+
_, _ = ParseRange(VERSION)
547547
}
548548
}
549549

semver_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ func BenchmarkParseSimple(b *testing.B) {
389389
b.ReportAllocs()
390390
b.ResetTimer()
391391
for n := 0; n < b.N; n++ {
392-
Parse(VERSION)
392+
_, _ = Parse(VERSION)
393393
}
394394
}
395395

@@ -398,7 +398,7 @@ func BenchmarkParseComplex(b *testing.B) {
398398
b.ReportAllocs()
399399
b.ResetTimer()
400400
for n := 0; n < b.N; n++ {
401-
Parse(VERSION)
401+
_, _ = Parse(VERSION)
402402
}
403403
}
404404

@@ -407,7 +407,7 @@ func BenchmarkParseAverage(b *testing.B) {
407407
b.ReportAllocs()
408408
b.ResetTimer()
409409
for n := 0; n < b.N; n++ {
410-
Parse(formatTests[n%l].result)
410+
_, _ = Parse(formatTests[n%l].result)
411411
}
412412
}
413413

@@ -416,7 +416,7 @@ func BenchmarkParseTolerantAverage(b *testing.B) {
416416
b.ReportAllocs()
417417
b.ResetTimer()
418418
for n := 0; n < b.N; n++ {
419-
ParseTolerant(tolerantFormatTests[n%l].result)
419+
_, _ = ParseTolerant(tolerantFormatTests[n%l].result)
420420
}
421421
}
422422

@@ -465,7 +465,7 @@ func BenchmarkValidateSimple(b *testing.B) {
465465
b.ReportAllocs()
466466
b.ResetTimer()
467467
for n := 0; n < b.N; n++ {
468-
v.Validate()
468+
_ = v.Validate()
469469
}
470470
}
471471

@@ -475,7 +475,7 @@ func BenchmarkValidateComplex(b *testing.B) {
475475
b.ReportAllocs()
476476
b.ResetTimer()
477477
for n := 0; n < b.N; n++ {
478-
v.Validate()
478+
_ = v.Validate()
479479
}
480480
}
481481

@@ -484,7 +484,7 @@ func BenchmarkValidateAverage(b *testing.B) {
484484
b.ReportAllocs()
485485
b.ResetTimer()
486486
for n := 0; n < b.N; n++ {
487-
formatTests[n%l].v.Validate()
487+
_ = formatTests[n%l].v.Validate()
488488
}
489489
}
490490

0 commit comments

Comments
 (0)