mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-05 07:26:51 +08:00
refactor: change variable name to
This commit is contained in:
@@ -27,16 +27,16 @@ func After(n int, fn any) func(args ...any) []reflect.Value {
|
||||
func Before(n int, fn any) func(args ...any) []reflect.Value {
|
||||
// Catch programming error while constructing the closure
|
||||
mustBeFunction(fn)
|
||||
var res []reflect.Value
|
||||
var result []reflect.Value
|
||||
return func(args ...any) []reflect.Value {
|
||||
if n > 0 {
|
||||
res = unsafeInvokeFunc(fn, args...)
|
||||
result = unsafeInvokeFunc(fn, args...)
|
||||
}
|
||||
if n <= 0 {
|
||||
fn = nil
|
||||
}
|
||||
n--
|
||||
return res
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user