Canonical guidance

Use when

Avoid

Preferred pattern

client := &http.Client{
	Timeout: 5 * time.Second,
}

Anti-pattern

Explanation: This anti-pattern is tempting because time.Duration is an integer type, but its default unit is nanoseconds, not whatever the reader hoped.

Why

Related pages

Sources