I have developed my web application on windows 10 using GoLand IDE, it’s working fine.
now I install GO in openSuse Leap 42.3 and I place my application under the folder /srv/www/htdocs/go/src
Do you have the same problem when you cross compile from windows using proper GOOS and GOARCH values? (can go actually crosscompile from win to linux, I’ve only done the other way round so far…)
Also it seems as if you have GOROOT and GOPATH swapped. GOROOT should contain system packages while GOPATH should be developers code.
This looks as if it were even worse than what you had before.
Please do yourself a favor and build the executable locally and only upload the binary to your server. Using either GOs cross compile capabilities or the go-docker-containers should be sufficient.
Or you could build in your home folder on the host. You do not need to put the sources or binary in /srv/www…
In general, I’d not put it into a path thats usually served by the distros favorite webserver. You run the danger of exposing secret stuff on package install or update then.
Just create a service (systemd-unit, upstart, initd, whatever your distro uses) and start it.