Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go test: incorrect line numbers in compilation errors with -coverprofile flag #14819

Closed
perillo opened this issue Mar 14, 2016 · 1 comment
Closed

Comments

@perillo
Copy link
Contributor

perillo commented Mar 14, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 linux/amd64

  2. What operating system and processor architecture are you using (go env)?

    GOARCH="amd64"
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GORACE=""
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
    
  3. What did you do?
    When the go test command, with the -coverprofile flag, needs to compile a source file, it reports errors using an incorrect line number.

    The problem can be reproduced running
    $go test -coverprofile=/tmp/out
    with this source file:
    https://play.golang.org/p/WAB6gv-0HC
    and test file:
    https://play.golang.org/p/LCkNJTTOQ1

  4. What did you expect to see?

    # test/bug01
    /tmp/go-build602734163/test/bug01/_test/_obj_test/bug.go:6: undefined: fmt.Printz
    FAIL    test/bug01 [build failed]
    
  5. What did you see instead?

    # test/bug01
    /tmp/go-build602734163/test/bug01/_test/_obj_test/bug.go:7: undefined: fmt.Printz
    FAIL    test/bug01 [build failed]
    
@perillo
Copy link
Contributor Author

perillo commented Mar 14, 2016

This is a duplicate of #6329.

@perillo perillo closed this as completed Mar 14, 2016
@golang golang locked and limited conversation to collaborators Mar 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants