diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b820fd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +hello-world diff --git a/hello.go b/hello.go index 4d55178..1b6124c 100644 --- a/hello.go +++ b/hello.go @@ -4,17 +4,22 @@ import ( "fmt" "net/http" "os" + "runtime" "time" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello world! Here's some info:\n\n") - time, _ := time.Now() + time := time.Now() + numCPU := runtime.NumCPU() + version := runtime.Version() hostname, _ := os.Hostname() - environ, _ := os.Environ() - uid, _ := os.Getuid() - gid, _ := os.Getgid() + environ := os.Environ() + uid := os.Getuid() + gid := os.Getgid() fmt.Fprintf(w, "Time: %v", time) + fmt.Fprintf(w, "CPUs: %v", numCPU) + fmt.Fprintf(w, "Go version: %v", version) fmt.Fprintf(w, "Hostname: %v\n", hostname) fmt.Fprintf(w, "Environment: %v\n", environ) fmt.Fprintf(w, "UID: %v GID: %v\n", uid, gid)