- Learning Functional Programming in Go
- Lex Sheehan
- 80字
- 2021-07-02 23:13:53
A decorator implementation
Our decorator pattern example will be runnable, so we'll put it in the main package and define a main() function.
We use the easy-metrics package for recording and displaying our metrics. It comes out of the box with a nice GUI for displaying statistics.
We also import the decorator package and preface that import with a dot (.) in order to access the identifiers in the decorator package, in the local file block without a qualifier.