Canonical guidance

Use when

Avoid

Preferred pattern

package debugserver

import (
	"log"
	"net/http"
	_ "net/http/pprof"
)

func Start() {
	go func() {
		log.Println(http.ListenAndServe("localhost:6060", nil))
	}()
}

Anti-pattern

Explanation: This anti-pattern is tempting because intuition is faster than instrumentation, but it often optimizes the wrong thing and adds complexity.

Why

Related pages

Sources