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

cmd/go: go test -coverprofile broken on 1.7rc2/OSX #16454

Closed
0x434d53 opened this issue Jul 21, 2016 · 4 comments
Closed

cmd/go: go test -coverprofile broken on 1.7rc2/OSX #16454

0x434d53 opened this issue Jul 21, 2016 · 4 comments

Comments

@0x434d53
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.7rc2 darwin/amd64
  2. What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxx/Dev/GOCODE"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7rc2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7rc2/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m5/04gz8l2941vgv9_8ggx_s8_80000gn/T/go-build004510646=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

  1. What did you do?

go test -coverprofile=cover.out

  1. What did you expect to see?

Correct paths to the source files in the cover.out file

  1. What did you see instead?

Every path starts with is prefixed with a _ and therefore cannot be found (for example from go tool cover -html=cover.out)

Actual output:
_/Users/xxx/dev/GOCODE/src/github.com/0x434D53/jose/jwa/signerverifier.go:18.13,22.2 3 1

it should be:
/Users/xxx/dev/GOCODE/src/github.com/0x434D53/jose/jwa/signerverifier.go:18.13,22.2 3 1

@ianlancetaylor ianlancetaylor added this to the Go1.7Maybe milestone Jul 21, 2016
@ianlancetaylor
Copy link
Contributor

Is this a change from 1.6?

@ianlancetaylor ianlancetaylor changed the title go test -coverprofile broken on 1.7rc2/OSX cmd/go: go test -coverprofile broken on 1.7rc2/OSX Jul 21, 2016
@0x434d53
Copy link
Author

0x434d53 commented Jul 21, 2016

I just checked: In go1.6.3 darwin/amd64 i have

github.com/0x434D53/jose/jwa/signerverifier.go:18.13,22.2 3 1

as the path in the cover.out, which will work fine with the cover tool.

So yes: Works correct in 1.6, broken in 1.7rc2.

@davecheney
Copy link
Contributor

The underscore comes from trying to use the go tool with code outside
GOPATH.

On Thu, Jul 21, 2016 at 12:32 PM, Ian Lance Taylor <notifications@github.com

wrote:

Is this a change from 1.6?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#16454 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAAcA2hAhct8vh_4TQM57PSzmUMJeumUks5qXtohgaJpZM4JRYj1
.

@0x434d53
Copy link
Author

0x434d53 commented Jul 21, 2016

I found the issue: I have my OSX volume formatted as case insensitive: My GOPATH is ~/Dev/GOPATH . Most tools also from the go toolchain also work when i am in ~/dev/GOPATH - for OSX this is the same directory. So Dave is right: Go at least thinks i am not in the GOPATH when i am in ~/dev/GOPATH and is half right/wrong.

@golang golang locked and limited conversation to collaborators Jul 21, 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

4 participants