So I have a decorator-like function to format functions output as markdown code block. Someting like this:
func mdFormat(f func() string) (func() string) {
return func() string {
return(fmt.Sprintf("```
%s
```", f()))
}
}
Is it actually OK to do it with such function or is there any better solutions that I don't see?