3 ms·
Initialization in Go: the power of init()
- dilap 11y agoDefinitely one of the parts of Go that seems most likely to lead to regret. Unspecified call order. Mandatory startup time penalties just for importing a package. Blech. (It is handy, though.)
- RamshackleJ 11y agoAbsolutely! its definitely a stumbling block when you first start getting into golang. Are the startup penalties for importing a package really that significant? Are there ways of reducing them?
- dilap 11y agoWell, it's up to the package -- you can make it as slow as you want, in theory :). But I confess it's just a hypothetical problem for me so far -- I haven't yet run into trouble from it yet. I think Go's general culture of restraint and light-weightness may help it here. (I've had tons of problems w/ this in python, which makes me suspicious of the feature generally.)