Skip to content

top-level-declaration-order

Default severity: warning

Files are easier to scan when top-level declarations appear as constants, variables, types, then functions. Imports are ignored, and init remains part of the function group.

type Client struct{}
const timeout = time.Second
const timeout = time.Second
var defaultClient Client
type Client struct{}
func New() Client { return Client{} }