Golang include packages


#1

Hi,
Did someone got a Golang Bot to work?
I’ve included the hlt directory but it isn’t found by the go compiler.

cannot find package “hlt” in any of:
/usr/local/go/src/hlt (from $GOROOT)
/home/worker/Halite/apiserver/worker/tmpnfz2rduh/3399_0_juztme/src/hlt

Regards


#2

It’s a nuisance. It expects /hlt to be in your GOROOT folder. Instead, I’d recommend going through all the .go files and replacing things with local imports.

i.e. import "./hlt" or import "../hlt" or whatever’s needed, also inside the hlt folder itself, where e.g. import hlt/input becomes import "./input"


#3

Many thanks!
To save any other golang user some time: Only MyBot.go is run!
If you want to use multiple files, place them in sub packages and import them locally.