...

Text file src/cmd/go/testdata/script/cover_blank_func_decl.txt

Documentation: cmd/go/testdata/script

     1[short] skip
     2go test -cover coverblank
     3stdout 'coverage: 100.0% of statements'
     4
     5
     6-- go.mod --
     7module coverblank
     8
     9go 1.16
    10-- a.go --
    11package coverblank
    12
    13func _() {
    14	println("unreachable")
    15}
    16
    17type X int
    18
    19func (x X) Print() {
    20	println(x)
    21}
    22
    23func (x X) _() {
    24	println("unreachable")
    25}
    26
    27-- a_test.go --
    28package coverblank
    29
    30import "testing"
    31
    32func TestX(t *testing.T) {
    33	var x X
    34	x.Print()
    35}

View as plain text