-
Notifications
You must be signed in to change notification settings - Fork 3
could not import error creeps up #24
Comments
I'm also experiencing this, particularly with paths in the same project. For example, given a layout like this:
where a.go imports 'github.com/project/b'. The only difference from @melvinodsa is that I am getting the error when I run gometalinter on my own, but all the application complies and runs without error. |
FWIW, it actually appears to be related to golang/go#12703. After I ran |
So sorry you're having issues. Sounds like I should consider creating a package that provides a context menu for a directory allowing you to run |
@joefitzgerald I think the issue is with the gotype. go install didn't resolve my issues. it still fails to get the standard packages (fmt, net/http etc.) imports recognized. I had two version's of Go. first one the 1.2 it gets everything right gometalinter is like superman. But my project which 1.6 based got me in trouble. alecthomas/gometalinter#91 raises concerns over this kind of issue. It would be really cool if gometalinter-linter identifies that the Go version and try not to use gotype, instead something else (I am not sure which ones 💇 ) |
@melvinodsa @joefitzgerald I ended up just doing this: "gometalinter-linter":
args: [
"--vendor"
"--disable=gotype"
"--fast"
"--json"
"./..."
] |
@sethvargo but the syntax check is ignored after gotype is disabled. |
@melvinodsa many of the other linters pick up errors |
Hi, just confirming that I'm also experiencing the same problem. I have errors with files from my own projects. Having a vendor folder did not resolved. |
For now, to make |
I've tried using |
I think this issue affects those who have their Go version >= 1.5. Others its fine I guess. The community has a discussion on the same and hope they will get it right in 1.7. It is referenced here :- golang/go#14727. Meanwhile we could have workaround like this:- intelligent disable gotype in gometalinter, if go version >= 1.5 and use other linters[have to look the posibility of that]. What are your thoughts about this? |
So, is this library basically broken for go 1.5+? (I'm using 1.6) It sounds weird that I'd need to wait for 1.7 for this to (maybe) be fixed, is that the case? |
No, it's not broken for go 1.5+. As a temporary workaround, periodically run |
Gotcha, I'll just wait for the fix ( |
This is fixed in |
Awesome! Looks like it's working for me. Thanks :) |
could not import fmt (can't find import: fmt) (gotype)
I am not getting any imports right. So the whole project is showing errors. But when I run my program it runs flawlessly. I tried running gometalinter independently from terminal. It has no issues but the gometalinter-linter showing error from gometalinter
The text was updated successfully, but these errors were encountered: