Skip to content

Commit 1336d2e

Browse files
committed
fix benchmark signatures
1 parent 3641056 commit 1336d2e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tut/stat/stat.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func main() {
3030
mean = mean + x
3131
}
3232
mean = mean / float64(len(data))
33-
fmt.Printf("Average: %.3f\n", mean)
33+
fmt.Printf("Mean: %.3f\n", mean)
3434

3535
var max float64
3636
for _, x := range data {
@@ -51,7 +51,7 @@ func main() {
5151

5252
var hist = map[float64]int{}
5353
for _, x := range data {
54-
hist[x] += 1
54+
hist[x]++
5555
}
5656
var key float64
5757
var val int

tut/stat/stat_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ func TestMode(t *testing.T) {
1717
func TestMedian(t *testing.T) {
1818
}
1919

20-
func BenchmarkMean(t *testing.T) {
20+
func BenchmarkMean(b *testing.B) {
2121
}
2222

23-
func BenchmarkMax(t *testing.T) {
23+
func BenchmarkMax(b *testing.B) {
2424
}
2525

26-
func BenchmarkMin(t *testing.T) {
26+
func BenchmarkMin(b *testing.B) {
2727
}
2828

29-
func BenchmarkMode(t *testing.T) {
29+
func BenchmarkMode(b *testing.B) {
3030
}
3131

32-
func BenchmarkMedian(t *testing.T) {
32+
func BenchmarkMedian(b *testing.B) {
3333
}

0 commit comments

Comments
 (0)