// library
Severity
Bucket
Do not put complex logic or long-running tasks in package `init()` functions. Keep `init()` minimal (if you use it at all), such as simple registration of types or default variable initialization. Perform real setup in explicit functions (like in `main` or a setup function called by main).
Be c sem areful when slicing out a small portion of a large slice or array. The resulting slice still references the entire original array. If you only need the small portion long-term, copy that data into a new slice to avoid keeping the large array in memory.
Do not use global (package-level) variables for mutable state whenever possible. Instead, encapsulate state in structs or pass it as parameters. If you must use a global variable (for configuration or caching), protect it with mutexes if concurrent access is possible and document its usage.