Ban `init()` functions in non-test Go files
Open
- Dominant language
- Go
- Stars
- 19.3k
- Forks
- 2k
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 264
Description
Per title.
They are way too convenient but come at unexpected costs, especially with respect to the OCI interface which pays the `init` cost redundantly. They also make it easy to allocate large data structures on the heap at startup that may never end up being needed, bloating memory.
Need some helper library to make it easier to do a 2-function pattern: one to kick off `init`-like work, and a second to join on the completion of that work, after which no further synchronization is needed.
Contributor guide
Assessment
This issue has not been assessed yet.