I'm using LiteIDE for Go. I have a Go file located here:
/Users/username/go/src/src/Helper/Helper.go
When I include the file using:
import "../Helper"
I get this error:
can't load package: /Users/username/go/src/src/projectA/main.go:4:8: local import "../Helper" in non-local package
Any ideas what I'm doing wrong?
You import packages by import path. For package
Helper
, located in$GOPATH/src/Helper/
, use:While they can work in some cases, relative paths aren't supported by the go toolchain, and are discouraged.