5 ms·
Everyone else is suggesting goimports, but here's another trick: import _ "unused/package" This is usually used to benefit from the packages' side-effects
by m_sahaf 10y ago
Everyone else is suggesting goimports, but here's another trick:
import _ "unused/package"
This is usually used to benefit from the packages' side-effects (e.g. trigger init() - mostly used in SQL drivers to register the driver).
- aleksi 10y agoBut then you have to remove blank identifier to actually use package.