If the benchmark function changes b.N, the testing package will get very confused.
As an example, this (contrived) function:
func Benchmark(b *testing.B) {
b.N = 1000000000
time.Sleep(time.Second)
}
will lead to this:
Benchmark-4 1000000000 1.00 ns/op
I've seen this in the wild, for example:
https://groups.google.com/forum/#!topic/golang-nuts/DjKNjpSHi3M