You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
main.go
package main
import (
"fmt"
"time"
)
func main() {
t := time.NewTicker(time.Duration(time.Second))
for range t.C {
fmt.Println("Exec")
}
}
main_test.go
package main
import "testing"
func TestMain(t *testing.T) {}
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
Tests with cover option fail because of syntax error, tests without coverage are passing
testing: Tests with cover option fail because of syntax error, tests without coverage are passing
Mar 25, 2015
Go version go1.4.1 linux/amd64
When looping over channel without actually looking at value cover is reporting error:
However app runs fine and tests without coverage are passing correctly.
Console
Code to reproduce:
The text was updated successfully, but these errors were encountered: