Can't resolve local packages - however application starts

Hi, 

Firstly, I'm a massive fan of the Jet Brains products and have been using PyCharm for years with absolutely no issues but this one has me stumped (probably an easy solution).

So I'm learning go and my file structure is:

name-of-api/

  bin/

  src/

    cmd/

      main.go

    name-of-api/

      name-of-api.go

    config/ etc...

Now from main.go I can import package "name-of-api"  and run the build etc and the application runs just fine, but in the inspection the import is red and says can't resolve file. This also means my autocomplete for packages and sub-packages isn't working for me.

I've set the top directory as sources root which fixes this in PyCharm but having no luck here, could someone advise? 

Thanks,

N.B. I'm new to Go, be nice

1 comment
Comment actions Permalink

Can you please provide a sample project where this happens? Or at least IDE screenshots (full IDE preferably) to better understand the code layout, what is the error message, and so on? Also what IDE version do you have?

0

Please sign in to leave a comment.