Canonical guidance

Use when

Avoid

Preferred pattern

const port = 8080
var p uint16 = port

Anti-pattern

Explanation: This is tempting because constants feel abstract, but representability is checked against the destination type at compile time.

Why

Related pages

Sources