All Projects → alex-leonhardt → go-decorator-pattern

alex-leonhardt / go-decorator-pattern

Licence: other
golang and decorators / decorator patterns

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-decorator-pattern

Learngo
1000+ Hand-Crafted Go Examples, Exercises, and Quizzes
Stars: ✭ 11,847 (+8741.04%)
Mutual labels:  learning-golang, learning-go
Cracking The Coding Interview Rust
Cracking the Coding Interview problem solutions in Rust
Stars: ✭ 246 (+83.58%)
Mutual labels:  learn-to-code
Inginious
INGInious is a secure and automated exercises assessment platform using your own tests, also providing a pluggable interface with your existing LMS.
Stars: ✭ 138 (+2.99%)
Mutual labels:  learn-to-code
Mud Pi
A simple MUD server in Python, for teaching purposes, which could be run on a Raspberry Pi
Stars: ✭ 184 (+37.31%)
Mutual labels:  learn-to-code
React Tutorial Exercises
Learn and practice React.js in this interactive tutorial with dozens of react exercises.
Stars: ✭ 161 (+20.15%)
Mutual labels:  learn-to-code
30 Seconds Of Php
Short PHP code snippets for all your development needs
Stars: ✭ 2,461 (+1736.57%)
Mutual labels:  learn-to-code
Ziglearn
Repo for https://ziglearn.org content. Get up to speed with Zig quickly.
Stars: ✭ 135 (+0.75%)
Mutual labels:  learn-to-code
You Dont Know Js
A book series on JavaScript. @YDKJS on twitter.
Stars: ✭ 147,493 (+109969.4%)
Mutual labels:  learn-to-code
30 Seconds Of Css
Short CSS code snippets for all your development needs
Stars: ✭ 14,945 (+11052.99%)
Mutual labels:  learn-to-code
Blocklike
Bridging the gap between block programming and JavaScript.
Stars: ✭ 177 (+32.09%)
Mutual labels:  learn-to-code
How To Markdown
Learn how to start using Markdown
Stars: ✭ 173 (+29.1%)
Mutual labels:  learn-to-code
Go Monkey
Code for "Writing An Interpreter in Go"
Stars: ✭ 168 (+25.37%)
Mutual labels:  learn-to-code
Python Awesome
Learn Python, Easy to learn, Awesome
Stars: ✭ 219 (+63.43%)
Mutual labels:  learn-to-code
Rtutor
Creating interactive R Problem Sets. Automatic hints and solution checks. (Shiny or RStudio)
Stars: ✭ 141 (+5.22%)
Mutual labels:  learn-to-code
Chigraph
A visual systems language for beginners compiled using LLVM
Stars: ✭ 247 (+84.33%)
Mutual labels:  learn-to-code
Carmel
The Open Digital Innovation Marketplace
Stars: ✭ 136 (+1.49%)
Mutual labels:  learn-to-code
Hackclub
🏫 Hack Club is a nonprofit network of computer science clubs where members learn to code through tinkering and building projects
Stars: ✭ 2,139 (+1496.27%)
Mutual labels:  learn-to-code
Javascript
GitBook teaching programming basics with Javascript
Stars: ✭ 2,525 (+1784.33%)
Mutual labels:  learn-to-code
Freecodecamp
freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
Stars: ✭ 339,510 (+253265.67%)
Mutual labels:  learn-to-code
30 Seconds Of Code
Short JavaScript code snippets for all your development needs
Stars: ✭ 89,121 (+66408.21%)
Mutual labels:  learn-to-code

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].