Better HN
top
new
best
ask
show
jobs
Log in
Sign up
How do you implement DI and Interfaces(Contracts) & Implementations on Golang? | Better HN
How do you implement DI and Interfaces(Contracts) & Implementations on Golang?
2 points · by
resotto
· 6y ago · 2 comments
I’m newbie gopher and I know there is no inheritance in Golang so how do you accomplish above purpose??
Thanks.
Comments
[–]
celestino_127
6y ago
In Golang, interfaces are used to circumvent that feature. There is no inheritance, instead Gophers use interfaces in code to share functionality between structs.
[–]
resotto
OP
6y ago
Got it. Thank you.