I am trying to log decorated function name before and after calling it as below.
Is it possible to get the decorated function name f1 in decorator to make it shows entering f1 and leaving f1.
package main
import (
"fmt"
)
func f1() {
fmt.Println("f1")
}
func decorator(f func()) {
fmt.Println("entering f.name")
f()
fmt.Println("leaving f.name")
}
func main() {
decorator(f1)
}