Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
venomsnake
· 13y ago · 0 comments
Can golang do function decorators - I have been using it for some pet projects (nothing fancy) but could not find this so loved python feature there?
Comments
[–]
supersillyus
13y ago
Yes, in the same sense that any language with first class functions can.
So, like:
var SomeFunc = RequireAuth(func(...) { ... });
However, there's no language-level support, so you can't decorate methods as easily as you might in a language like Python.