How to correctly install and configure the Go Language in Ubuntu. There are many packages to choose from but which packages do I need to install and what do I need to configure afterwards to be able to use any of the Go packages without having a "cannot find package" error for example or any other basic errors of that kind.
I installed the golang package but do I need to install any additional ones or configure something else?
As an example try to run the following:
package main
import (
"http"
"log"
)
func HelloServer(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "text/plain")
w.Header().Set("Connection", "keep-alive")
w.Write([]byte("hello, world!\n"))
}
func main() {
http.HandleFunc("/", HelloServer)
log.Println("Serving at http://127.0.0.1:8080/")
http.ListenAndServe(":8080", nil)
}