Skip to content

Incorrect line number for compiling error when -cover for "go test" #13990

Closed
@daviddengcn

Description

@daviddengcn

go test t.go t_test.go and go test t.go t_test.go -cover show different line numbers for compiling error (12 vs 14) with same error message. Is this expected?

t.go:

package t

import(
  "fmt"
)

func T() {
  fmt.Println("Hello")
}

func b() {
  var i int = ""
}

t_test.go:

package t

import(
  "testing"
)

func Test(t *testing.T) {
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions