I am a Go rookie. I want to use the Prometheus monitoring function level and try to be as generic as possible, like spring transactional. Using aspect oriented programming. I tried the following:
type BizFunc func()
func DoAndMonitor(bizFunc BizFunc) {
// monitor begin
defer func() {
// monitor end
}()
bizFunc()
}
but there is no function type that's compatible with any function.
So I wonder whether this can be implemented in Go?