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

Doesn't work with symlinks #126

Closed
nebiros opened this issue Jun 23, 2018 · 2 comments
Closed

Doesn't work with symlinks #126

nebiros opened this issue Jun 23, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@nebiros
Copy link

nebiros commented Jun 23, 2018

~/go/src/github.com/my-api/my-api is a symlink of /Users/nebiros/OneDrive/Projects/my-api

✔ ~/go/src/github.com/my-api
12:08 $ ls -la
lrwxr-xr-x   1 nebiros  staff    43B Apr 11 16:17    ~/go/src/github.com/my-api/my-api -> /Users/nebiros/OneDrive/Projects/my-api

But, when I run this:

/usr/local/bin/golangci-lint run --print-issued-lines=false /Users/nebiros/go/src/github.com/my-api/my-api/workout/log.go

Inside ~/go/src/github.com/my-api/my-api I got this error:

ERRO Running error: can't find path ../../../../../OneDrive/Projects/my-api/workout/log.go: stat ../../../../../OneDrive/Projects/my-api/workout/log.go: no such file or directory
@jirfag jirfag added the bug Something isn't working label Jun 24, 2018
@jsedgwick
Copy link

jsedgwick commented Jul 26, 2018

Running into something similar. The repos for most of my company (call it foo) live in ~/go/src/github.com/foo/, so I have a symlink ~/gofoo/ to get to our repos quickly. However, I get errors like the one reported above, and other arcane ones like

WARN [runner] Can't run linter govet: can't run govet on source packages: can't read "../../go/src/github.com/foo/myrepo/bar.go
and
WARN [runner] Can't run linter golint: no AST for file myrepo/bar.go in cache
and
WARN [runner] Can't run linter goconst: no AST for file myrepo/bar.go in cache

the latter two followed by a giant debug spew, the one here:
'

return nil, nil, fmt.Errorf("no AST for file %s in cache: %+v", filename, *ctx.ASTCache)

If I go to the repo directly without my symlink, everything is fine.

@jirfag any thoughts?

@jirfag
Copy link
Member

jirfag commented Jul 29, 2018

thank you for reporting,
@nebiros @jsedgwick I reproduced and fixed your cases

golangci pushed a commit that referenced this issue Jul 29, 2018
golangci pushed a commit that referenced this issue Jul 29, 2018
golangci pushed a commit that referenced this issue Jul 29, 2018
@jirfag jirfag closed this as completed in 973c9fd Jul 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants