Created
February 22, 2019 12:04
-
-
Save J7mbo/ad87a9bd2874dca8c595bb1c909de68c to your computer and use it in GitHub Desktop.
golang-constructors-blog-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type MyStruct struct { } | |
| func NewMyStruct() MyStruct { | |
| return MyStruct{dep: ADependency{}} | |
| } | |
| type ADependency struct { } | |
| myStruct := NewMyStruct() // We get back a valid struct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment