package mainpackage main
import (
"fmt"
"log"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello from Go web server! You requested: %s\n", r.URL.Path)
}
func main() {
http.HandleFunc("/", handler)
log.Println("Server starting on http://localhost:8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}
To embed this project on your website, copy the following code and paste it into your website's HTML: