deferpanic / goweave

Aspect Oriented Programming for Go
MIT License
225 stars 9 forks source link

support windows and modify function's arguments' type check algorithm #10

Closed yaozijian closed 9 years ago

yaozijian commented 9 years ago

1 Add support of Windows 2 Modify the function's argument type compare algorithm (in function "containeArgs" at weave/ast.go) check function's every argument,include the arguments not use package.

For example: func blah(a, b string, x int) error { fmt.Println(strconv.Itoa(x)) return nil }

and the weave file: aspect { pointcut: execute(blah(string,string,int) int) advice: { before: { fmt.Println("call blah: x=",x) } } } 3 in weave/weave_test.go and within_test.go: /tmp ---> os.TempDir() so it can work in both Linux and Windows

I have tested in Linux and Windows,but I have no Darwin system,so it is not tested in Drawin system.