Created
August 5, 2022 21:24
-
-
Save oxtoacart/863451be674eb6e7b9598a811d8e4968 to your computer and use it in GitHub Desktop.
This file contains 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 Display interface { | |
DrawSomething() | |
} | |
type display struct {} | |
func (d *display) DrawSomething() { | |
... | |
} | |
type Computer struct { | |
Display Display | |
} | |
func NewComputer(display Display) *Computer { | |
return &Computer{Display: display} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment