I have the most basic net/http program that I\'m using to learn the namespace in Go:
package main
import (
\"fmt\"
\"log\"
\"net/http\"
)
func
Yes, use HandleIndex(w, r) instead of go HandleIndex(w, r) will fix your issue, I think you have already figured that out.
The reason is simple, when handling multiple requests at the same time, the http server will start multiple goroutines, and your handler function will be called separately in each of the goroutines without blocking others. You don't need to start your own goroutine in the handler, unless you practically need it, but that will be another topic.