Skip to content

Commit

Permalink
Moving print statement before listen
Browse files Browse the repository at this point in the history
  • Loading branch information
me-heer committed Jan 13, 2024
1 parent 057bfda commit 2171ad3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sample_http_server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func blazinglyFastHandler(w http.ResponseWriter, r *http.Request) {
}

func main() {
println("Listening at 127.0.0.1:12345")
http.HandleFunc("/", blazinglyFastHandler)
err := http.ListenAndServe("127.0.0.1:12345", nil)
println("Listening at 127.0.0.1:12345")
if err != nil {
println(err.Error())
log.Fatal("I couldn't serve")
Expand Down

0 comments on commit 2171ad3

Please sign in to comment.