Skip to content

Commit

Permalink
re-export OnInitPre and OnExitPost
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Jun 20, 2024
1 parent 251d90b commit 7f62d19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defaults_onexit.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ func ExitWait() { ExitWaitFunc.Get()() }

// OnExit registers the exit function f, which is the proxy of assists.OnExit.
func OnExit(f func()) { assists.OnExit(f) }

// OnExitPost registers the post-exit function f, which is the proxy of assists.OnExitPost.
func OnExitPost(f func()) { assists.OnExitPost(f) }
3 changes: 3 additions & 0 deletions defaults_oninit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ import "github.com/xgfone/go-defaults/assists"

// OnInit registers the init function f, which is the proxy of assists.OnInit.
func OnInit(f func()) { assists.OnInit(f) }

// OnInitPre registers the pre-init function f, which is the proxy of assists.OnInitPre.
func OnInitPre(f func()) { assists.OnInitPre(f) }

0 comments on commit 7f62d19

Please sign in to comment.