gogap / aop

Aspect Oriented Programming For Golang
Apache License 2.0
384 stars 51 forks source link

fix: fix panic when round is not used #10

Closed ttylzhu closed 2 years ago

ttylzhu commented 2 years ago

In example/main.go, if delete line aspect.AddAdvice(&aop.Advice{Ordering: aop.Around, Method: "Around", PointcutRefID: "pointcut_1"}), panic will rise. The reason is that in aop.go, realFunc has argumentsargs ...interface{} while in retValues = realFunc(inputs) inputs has type []reflect.value. So args will always have length 1.