I have been working through An Introduction to Programming in Go by Caleb Doxsey over the last week when I hit a small issue that happened to waste a lot of time (read my earlier post on ‘Getting Started’ ). If you ever happen to hit an issue whereby you have Go code that you can’t compile and run. Make sure that all your Go files are in the correct folders of the project before attempting anything else. In eclipse it is very easy to end up losing Go code files in other folders and since there are no errors displayed, It is very easy to over-diagnose the problem. So if you ever run into an issue where you have code that doesn’t build or run; and there are no errors in your code or any errors being displayed in your IDE; make sure your code files and packages are in the correct folders before attempting anything else. The Go code files should be in the ‘src ’ folder, the packages should be in the ‘pkg ’ folder and all executables should be in the ‘bin ’ folder.
This Golang article essentially covers the issue.