A thought experiment in designing a Dependency Injection pattern for GoLang, bringing out subtle nuances of the language, especially when compared to traditional object oriented languages. Brings out possibilities and challenges of the language, and enlightens you on things you shouldn’t do!
Presented in GopherCon India, February 2018.
25. Benchmarking
* Metrics are approximate, in nanoseconds, best of 3 values, calculated on a nice cloudy February Wednesday
Functions to Variables 2.69 46.10
New Functions 0.39 1.55
Singleton* New / Request*
karlkfi/inject - 6167.00
sarulabs/di 82.90 2543.00
DUTDIP 9.96 49.00