Closed Dynom closed 8 years ago
Sorry, I don't understand your issue. None of those warnings are produced by unconvert.
Can you please provide: 1) the unconvert command you ran, 2) the actual output produced, and 3) the output you expected to be produced?
Thanks!
Oh, sorry, I see "(unconvert)" now. Odd.
I suspect there's something wrong with your /usr/local/go directory that's causing go/types to fail to type check the packages. Can you provide the output from ls /usr/local/go/src/os/user
?
/usr/local/go
is a symlink, not sure if that's significant.
It's quite likely this is significant. It might be that the check if a package is inside GOROOT is failing when your /usr/local/go
is a symlink, causing it to think os/user
is a 3rd party package.
This is just a guess based on that others (without symlinks) don't seem to run into this issue.
I'm actually now suspecting it's a problem related to cgo and/or build tags. Not sure how to diagnose that though.
@shurcooL I think the symlink approach is common. I don't recall doing anything specific with it and so it's probably setup by Homebrew. Again I'm not entirely sure.
@mdempsky
$ l /usr/local/go/src/os/user
total 56
drwxr-xr-x 9 mark admin 306B Apr 20 01:50 ./
drwxr-xr-x 68 mark admin 2.3K Apr 20 01:50 ../
-rw-r--r-- 1 mark admin 645B Apr 20 01:50 lookup.go
-rw-r--r-- 1 mark admin 855B Apr 20 01:50 lookup_plan9.go
-rw-r--r-- 1 mark admin 699B Apr 20 01:50 lookup_stubs.go
-rw-r--r-- 1 mark admin 3.1K Apr 20 01:50 lookup_unix.go
-rw-r--r-- 1 mark admin 3.4K Apr 20 01:50 lookup_windows.go
-rw-r--r-- 1 mark admin 1.1K Apr 20 01:50 user.go
-rw-r--r-- 1 mark admin 1.8K Apr 20 01:50 user_test.go
Also:
I suspect there's something wrong with your /usr/local/go directory that's causing go/types to fail to type check the packages. Can you provide the output from ls /usr/local/go/src/os/user?
That might be the case, but why does it check those paths in the first place..?
I solved it.. I updated Xcode to a more recent version and now I have no errors.
Xcode includes clang, right? Perhaps it fixed something related to cgo. No idea how though, since go/types doesn't actually invoke cgo. :-/
Glad to hear it's fixed at least.
I've reported it before here: https://github.com/alecthomas/gometalinter/issues/149, but I think that this is a better place to report it.
I'm not (yet) sure why, but some linters generate a report from
/usr/local/go
.I'm on
go version go1.6.2 darwin/amd64
/usr/local/go
is a symlink, not sure if that's significant.When I try to run
unconvert
directly, I get similar behaviour.