package main import ( "fmt" "net/http" ) func main() { // anonyme Funktion definieren und ausführen func () { fmt.Println("Hallo Welt") }() // anonyme HTTP-Handler-Funktion http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hallo Welt")) }) http.ListenAndServe(":8080") }