Putting Methods and Interfaces in Context
Question | Answer |
---|---|
What are they? | Methods are functions that are invoked on a struct and have access to all of the fields defined by the value’s type. Interfaces define sets of methods, which can be implemented by struct types. |
Why are they useful? | These features allow types to be mixed and used through ... |