Go version go1.4.1 linux/amd64
When looping over channel without actually looking at value cover is reporting error:
expected operand, found 'range' (and 1 more errors)
However app runs fine and tests without coverage are passing correctly.
Console
$ go test
PASS
ok _/home/fuxi/test 0.003s
$ go test -cover
# cover _/path/test
2015/03/25 22:45:53 cover: /path/test/main.go: /path/test/main.go:10:9: expected operand, found 'range' (and 1 more errors)
FAIL _/path/test [build failed]
Code to reproduce:
package main
import (
"fmt"
"time"
)
func main() {
t := time.NewTicker(time.Duration(time.Second))
for range t.C {
fmt.Println("Exec")
}
}
package main
import "testing"
func TestMain(t *testing.T) {}