December 2021
Intermediate to advanced
510 pages
11h 20m
English
You’ve made good progress on your to-do list tool so far, but the list output is still not very informative. At this moment, this is what you see when executing the tool with the -list option:
| | $ ./todo -list |
| | Another ToDo item |
| | Improve usage |
| | Improve output |
Various ways exist for improving the output formatting. For instance, if you don’t own the API code, your only alternative is to format the output in the command-line tool implementation. But you own the API, so we can leverage the powerful Interfaces feature of Go to implement the list output formatting in the todo.List type directly. With this approach, anyone using your API experiences a consistent output format.
An interface in Go implements ...
Read now
Unlock full access