Skip to content

Instantly share code, notes, and snippets.

@kaperys
Created February 1, 2019 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaperys/e4ea7736b7e26e37ebc0f68d34454eb6 to your computer and use it in GitHub Desktop.
Save kaperys/e4ea7736b7e26e37ebc0f68d34454eb6 to your computer and use it in GitHub Desktop.
Delve Docker main.go
package main
import (
"log"
"net/http"
"strings"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
message := r.URL.Path
message = strings.TrimPrefix(message, "/")
message = "Hello, " + message + "!"
w.Write([]byte(message))
})
log.Print("starting web server")
if err := http.ListenAndServe(":1541", nil); err != nil {
log.Fatal(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment