Misusing init functions (#3)
Official 100go entry on keeping `init` rare, predictable, and free of hidden application logic.
Official 100go entry on keeping init rare, predictable, and free of hidden application logic.
- Author: Teiva Harsanyi
- Authority: community
- Kind: guide
- URL: https://100go.co/#misusing-init-functions-3
What it covers
- init boundaries
- hidden side effects
- initialization alternatives
Why authoritative
Official 100go website entry for this specific mistake.
Use when
- should this use an init function in Go
- is this package init too heavy
- what belongs in init in Go
Keywords
- init, package initialization, side effects, startup, predictability