I am pretty new to GO. I was trying few examples and one of them was to use cgo to call a C code from GO.
Here is the example I am trying: https://code.google.com/p/go-wiki/wiki/cgo
With the above link as a reference I created a package structure as below:
gocode/src/github.com/mypkg/test.go
"mypkg" is the custom package that I have created and used it in the test.go as below:
package mypkg
I get an error when I run my go program. "go run: cannot run non-main package"
I have set my GOPATH to the GO source code folder.
GOPATH=/xyz/gocode/src/
I searched for solutions and found the below links which says, custom pacakages cannot be created: https://groups.google.com/forum/#!topic/golang-nuts/vmebkoqYMH4
http://stackoverflow.com/questions/23870801/go-run-cannot-run-non-main-package
But, All the code I see is with a custom pacakage name. Please help me to resolve this issue.
Any help is really appreciated.
Thanks