Andrew's Digital Garden

If in Go

The if in Go can contain an initialization statement, which prepares the variable used in the condition statement.

if err := f(x); err != nil { return err }

[[go]]

If in Go