Created
August 31, 2015 07:07
-
-
Save rochacon/188b0929ab42a87721f0 to your computer and use it in GitHub Desktop.
Simple Go app to print an UUID per instance. Useful to debug load balancers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-uuid/uuid" | |
"net/http" | |
) | |
var ( | |
id []byte = []byte(uuid.New() + "\n") | |
) | |
func main(){ | |
http.HandleFunc("/", getId) | |
println("Listening on 0.0.0.0:8000") | |
http.ListenAndServe(":8000", nil) | |
} | |
func getId(w http.ResponseWriter, r *http.Request) { | |
w.Write(id) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment