Work with Go Http Server

package main

import (
	"io"
	"net/http"
)

func main() {
	http.HandleFunc("/",sayHello)
	http.HandleFunc("/index", serverFile)
	http.ListenAndServe(":8000", nil)
}

func sayHello(writer http.ResponseWriter, request *http.Request)  {
	io.WriteString(writer,"Hello World")
}

func serverFile(responseWriter http.ResponseWriter, request *http.Request) {
	http.ServeFile(responseWriter,request,"index.html")
}

References

Install Go on Ubuntu and Windows

tar xvf go1.6.linux-amd64.tar.gz

You should now have a directory called go in your home directory

sudo chown -R root:root ./go
sudo mv go /usr/local
sudo nano ~/.profile
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
source ~/.profile

Windows
Set GOROOT, GOPATH, GOBIN System Variable
References
https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-16-04
http://www.wadewegner.com/2014/12/easy-go-programming-setup-for-windows/
https://stackoverflow.com/questions/25216765/gobin-not-set-cannot-run-go-install