mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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"
|
||||
)
|
||||
|
||||
func helloFromKubernetes(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "Hello World! -- Kubernetes")
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", helloFromKubernetes)
|
||||
err := http.ListenAndServe(":8080", nil)
|
||||
if err != nil {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintln(w, "Hello World! -- Kubernetes")
|
||||
})
|
||||
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||
panic("ListenAndServe: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user