This is a collection of patterns and implementations I've found while learning Go
https://golangforall.com/en/post/dependency-injection.html#dependency-injection-container-(injector)
Useful when there's a lot of options that must be configured. See internanl/constructor
https://www.theelements.org/2016/05/30/the-builder-pattern-in-go/ https://golang.cafe/blog/golang-functional-options-pattern.html - Option 2 https://golangbot.com/structs-instead-of-classes/
Extensible and easy to read, used by the AWS Go SDK. See internal/options
https://dave.cheney.net/2016/11/13/do-not-fear-first-class-functions https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis
https://golang.cafe/blog/golang-functional-options-pattern.html - Option 3 https://www.sohamkamani.com/golang/options-pattern/ https://medium.com/star-gazers/go-options-pattern-da49185a2526 https://www.calhoun.io/using-functional-options-instead-of-method-chaining-in-go/
Similar to a factory pattern. See internal/functional
https://devcharmander.medium.com/go-builder-pattern-the-functional-way-e40f347017ce
Constructor pattern with interfaces
https://refactoring.guru/design-patterns/builder/go/example#example-0--iBuilder-go https://golangbot.com/interfaces-part-2/ https://gist.github.com/vaskoz/10073335