I have a few packages in separate folders for my golang project that is getting a bit big. I've been trying to create separate packages but don't get detected by goimports
GOPATH="/home/malek/go:/home/malek/Desktop/Workspace"
GORACE=""
GOROOT="/usr/local/go"
My directory is as such,
Workspace -> src -> application -> utility -> math.go
and in my math.go folder, I have package utility
But when I try to do import "application/utility"
or when i try to include a public function from the math.go file in my main.go file (in application folder), I get undefined...
What am I doing wrong?
You haven't provided us with specific steps to reproduce your problem. I don't see a problem.
goimports -w main.go
works. For example,application/main.go
beforegoimports -w main.go
:application/utility/math.go
:Commands:
Output:
application/main.go
aftergoimports -w main.go
: