I do understand Go is quirky for imports, but I've tried following the convention (I believe) to the point, however I cannot import a struct.
Project structure:
/project-name
/parser/main.go
/query/main.go
... Project files in root
I have a struct in /parser/main.go
exported:
package parser
type SomeTranslationStuff struct {
ID int `json:"Id"`
Language string `json:"Language"`
}
I wish to import this in /query/main.go
.
I do it as such:
import (
"github.com/org/project-name/parser"
)
It does not import it - I am met with "cannot find package ... in Gopath".
My project exists under: Users\user\go\src\project-name
. The imported project(which is the same project, imported from github via go get) does indeed exist in Users\user\go\src\github.com\org\project-name
.. Everything seems according to the "Go"-way of importing stuff, yet it doesn't appear to import?
It specifically says:
Cannot find package name:
C:\Users\user\go\src\github.com\org\project-name\parser(from $GOPATH)
If I go to that path, the project is, correctly, there! What gives? Why doesn't it import?