Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample of Golang server
/*
* Golang server
*/
package main
import (
"io"
"net/http"
)
func sayHi(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world!")
}
func main() {
http.HandleFunc("/", sayHi)
http.ListenAndServe(":8000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment