I am new to golang and trying to learn and take the benefits of go’s cocurrency capabilities. The thing I am trying to do is rewrite my current python application which sole purpose is to asyncroizely getting command outputs from a large amount of ssh servers. I found go is very suitable for this task. However, my pain point is I am having difficulties deploy my go applications on Solaris 10 environments using gccgo. I manage to create a simple hello world application on Solaris 10, but when I try to add more packages in my applications the go tool in gccgo is not really helping me to compile the codes. Here is some details when I try to compile the applications:
when using gotool to compile i got following errors:
bash-3.2$ /opt/csw/bin/go-5.2 build --compiler gccgo
kidce.go:3:9: cannot find package “fmt” in any of:
/opt/csw/lib/src/fmt (from $GOROOT)
/export/home/eheh/go-dev/src/fmt (from $GOPATH)
package ere.us/kidce
imports runtime: cannot find package “runtime” in any of:
/opt/csw/lib/src/runtime (from $GOROOT)
/export/home/eheh/go-dev/src/runtime (from $GOPATH)
I read some articals on the internet about the go abilities for Solaris, and it cross compile feature only support later Solaris 11 versions. So this won’t help me at this moment. I just don’t understand if gccgo can support using go on Solaris 10, why its go tool not being useful or is I miss anything. I am aware that this might not be best place to ask questions about go for gcc enviroment. I just feel that maybe someone has similar experience as I have and can guild me through it.
It looks like the go tool isn’t able to find the standard library source. Possibly it’s not built correctly or installed in an unexpected location. Can you point to it explicitly with GOROOT?
Thank you for your reply, I actually did this and the error is as follows:
kidce.go:4:2: cannot find package “fmt” in any of:
/opt/csw/lib/go/5.2.0/i386-pc-solaris2.10/src/fmt (from $GOROOT)
/export/home/eheh/go-dev/src/fmt (from $GOPATH)
package runtime: no buildable Go source files in /opt/csw/lib/go/5.2.0/i386-pc-solaris2.10/src/runtime
I don’t know what those gox things are, but they don’t appear to be the source that Go expects? You should have a directory fmt with .go files in it. (And the same for all other standard library packages.)