gogap / aop

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

Demo code executes fail #5

Open Reese1995 opened 3 years ago

Reese1995 commented 3 years ago

Here is my output:

Before Login: zeal @Begin Around @Proceed Result is false @End Around After Login: zeal gogap panic: reflect: wrong return count from function created by MakeFunc

goroutine 1 [running]: reflect.callReflect(0xc000078b10, 0xc00010fed8, 0xc00010fec0) C:/Go/src/reflect/value.go:567 +0x74d reflect.makeFuncStub(0x8c1e22, 0x4, 0x8c2054, 0x5, 0xc000078b10, 0x0, 0x0, 0x1, 0xa, 0x8c3218, ...) C:/Go/src/reflect/asm_amd64.s:20 +0x49 main.main() C:/Users/xxxxxxxxx/go/src/awesomeProject2/aop.go:64 +0x3cd

xujinzheng commented 3 years ago

Please parse your code here, example is correct

➜  example git:(master) pwd
/go/src/github.com/gogap/aop/example

➜  example git:(master) go get -v -u

➜  example git:(master) go run main.go
==========Func Type Assertion==========
Before Login: zeal
@Begin Around
@Login fakeName fakePassword
@Proceed Result is false
@End Around
After Login: zeal gogap
Login result: false
================Invoke=================
Before Login: zeal
@Begin Around
@Login fakeName fakePassword
@Proceed Result is false
@End Around
After Login: zeal errorpassword
Login result: false
1 bumd03i3k1kb1qtk2epg auth main.(Auth).Login Before
2 bumd03i3k1kb1qtk2epg auth main.(Auth).Login Around
3 bumd03i3k1kb1qtk2epg auth main.(Auth).Login *Login
4 bumd03i3k1kb1qtk2epg foo main.(Auth).Login Bar
5 bumd03i3k1kb1qtk2epg auth main.(Auth).Login After
6 bumd03i3k1kb1qtk2eq0 auth main.(Auth).Login Before
7 bumd03i3k1kb1qtk2eq0 auth main.(Auth).Login Around
8 bumd03i3k1kb1qtk2eq0 auth main.(Auth).Login *Login
9 bumd03i3k1kb1qtk2eq0 foo main.(Auth).Login Bar
10 bumd03i3k1kb1qtk2eq0 auth main.(Auth).Login After

➜  example git:(master) go version
go version go1.13.10 darwin/amd64