AZAreesh Zafarinareeshzafar.hashnode.dev·Apr 11 · 3 min readsql.Open() doesn't open anythingWe all know the basic drill of connecting a db in Go: func main(){ //... dsn := flag.String("dsn", "web:password@/demoProject", "MySQL data source name") flag.Parse() db, err := openDB(*dsn) if err 00
AZAreesh Zafarinareeshzafar.hashnode.dev·Apr 8 · 2 min read(Golang)You've Been Calling It a Handler Wrong All AlongWhen routing in go, we attach a normal function to a router and call it a handler, for example : package main func home(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello from Snippe00
AZAreesh Zafarinareeshzafar.hashnode.dev·Apr 7 · 3 min readHow Go's Server Multiplexer Actually Works What is ServeMux in Go? ServeMux is a request router that decides which function should handle an incoming request, it matches the URL of an incoming http request to a set of registered patterns which00