

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Interfaces in Go
incomplete
2: Interface Implementation
incomplete
3: Interfaces Are Implemented Implicitly
incomplete
4: Interfaces Quiz
incomplete
5: Multiple Interfaces
incomplete
6: Name Your Interface Parameters
incomplete
7: Type Assertions in Go
incomplete
8: Type Switches
incomplete
9: Clean Interfaces
incomplete
10: Message Formatter
incomplete
11: Process Notifications
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A type can implement any number of interfaces in Go. For example, the empty interface, interface{}, is always implemented by every type because it has no requirements.
Complete the required methods so that the email type implements both the expense and formatter interfaces.
Complete the cost() method:
Complete the format() method.
'CONTENT' | Subscribed
'CONTENT' | Not Subscribed
The single quotes are included in the string, and CONTENT is the email's body. For example:
'Hello, World!' | Subscribed
You may want to import the fmt package and use Sprintf.