mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Style tweaks to clean up hello.go.
This commit is contained in:
parent
053e75d8e9
commit
f745678f80
@ -21,14 +21,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func helloFromKubernetes(w http.ResponseWriter, r *http.Request) {
|
|
||||||
fmt.Fprintln(w, "Hello World! -- Kubernetes")
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
http.HandleFunc("/", helloFromKubernetes)
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
err := http.ListenAndServe(":8080", nil)
|
fmt.Fprintln(w, "Hello World! -- Kubernetes")
|
||||||
if err != nil {
|
})
|
||||||
|
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||||
panic("ListenAndServe: " + err.Error())
|
panic("ListenAndServe: " + err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user