Skip to content

Commit

Permalink
reversed chain
Browse files Browse the repository at this point in the history
sdfsdhgjkbmnmxc committed Mar 22, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9c92107 commit e2c3c2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swap.go
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ import "time"

func Chain(fns ...func()) func() {
return func() {
for _, fn := range fns {
fn()
for i := len(fns) - 1; i > 0; i-- {
fns[i]()
}
}
}

0 comments on commit e2c3c2a

Please sign in to comment.