add: summaries iface
This commit is contained in:
@ -17,3 +17,18 @@ func main() {
|
||||
l.discount(.5)
|
||||
l.print()
|
||||
}
|
||||
|
||||
/*
|
||||
Summary:
|
||||
|
||||
- Prefer to work directly with concrete types
|
||||
- Leads to a simple and easy to understand code
|
||||
- Abstractions (interfaces) can unnecessarily complicate your code
|
||||
|
||||
- Separating responsibilities is critical
|
||||
- Timestamp type can represent, store, and print a UNIX timestamp
|
||||
|
||||
- When a type anonymously embeds a type, it can use the methods of the embedded type as its own.
|
||||
- Timestamp embeds a time.Time
|
||||
- So you can call the methods of the time.Time through a timestamp value
|
||||
*/
|
||||
|
Reference in New Issue
Block a user