Go Decorator Pattern Save Abandoned

golang and decorators / decorator patterns

Project README

golang and the decorator pattern

a playground for me (and maybe helpful for others?) to train the brain understand the decorator pattern better

  • a basic function decorator, see example1
  • a basic timing decorator (how long does func X take?), see example2
  • decorating a method (think OOP), see example3
  • another method decorator, but using a Func type, useful when the func signature is rather long, see example4
  • method decorator that takes arguments example5
  • return the result from the decorated function, instead of printing it example6
  • a logging decorator, see example7
  • a nested decorator example, see example8
  • passing data to a http handler is a little weird (to me), but a fully working example is here: go-web-random
  • let's play with a interface example9

contribute

pull requests are welcomed

Open Source Agenda is not affiliated with "Go Decorator Pattern" Project. README Source: alex-leonhardt/go-decorator-pattern
Stars
130
Open Issues
0
Last Commit
6 years ago

Open Source Agenda Badge

Open Source Agenda Rating