[short] skip | |
go test -cover coverblank | |
stdout 'coverage: 100.0% of statements' | |
-- go.mod -- | |
module coverblank | |
go 1.16 | |
-- a.go -- | |
package coverblank | |
func _() { | |
println("unreachable") | |
} | |
type X int | |
func (x X) Print() { | |
println(x) | |
} | |
func (x X) _() { | |
println("unreachable") | |
} | |
-- a_test.go -- | |
package coverblank | |
import "testing" | |
func TestX(t *testing.T) { | |
var x X | |
x.Print() | |
} |