I have no experience on GoLang.
I have a Go project and I want to run it on my local server on my ubuntu 14.04. I have installed Go server and Go agent and they are running.
hesam: ~ $ sudo /etc/init.d/go-server start
[sudo] password for hesam:
using default settings from /etc/default/go-server
Started Go Server on http://hesam:8153/go
hesam: ~ $ sudo /etc/init.d/go-agent start
[Fri Nov 27 20:46:44 MST 2015] using default settings from /etc/default/go-agent
Started Go Agent.
hesam: ~ $
Based on what command line said /var/go/
is the folder that I can use to put my GO project inside. Based on what I know in Apache server there is www
folder that we will have access to from localhost. So, I'm expecting something like this with Go server (but seems I'm wrong).
My project contains some folders such as client
, config
, protocol
, server' and two files
chat.jsonand
main.go. I thought
main.goacts as
index.html` or similar.
So, how can I run the project on server?
The go-server
and go-agent
are part of the Go continuous delivery system and are absolutely not needed to run a program written in the Go programming language.
Actually, you don't need anything to run a compiled program written in Go, since it is statically compiled (by default, dynamic linking available), meaning that all necessary libraries are put into the executable itself and the executable is self sufficient (within certain limits, but that is an edge case, here).
So in order to run a Go program, just build it and call it like
$ /path/to/programName
Hello, World!
(assuming you build the classical example).
Please see How to Write Go Code for details.