summaryrefslogtreecommitdiff
path: root/src/util/atexit.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-07 01:06:42 +0900
committerGitHub <noreply@github.com>2024-05-07 01:06:42 +0900
commite8405f40fe2eb3675f1cb4f69e825eff5f13f269 (patch)
treec917367f1f0098939f9cdf7376a2a135907024fc /src/util/atexit.go
parent065b9e6fb2ce3e6e50ff423c3786989afa04ee14 (diff)
downloadfzf-e8405f40fe2eb3675f1cb4f69e825eff5f13f269.tar.gz
Refactor the code so that fzf can be used as a library (#3769)
Diffstat (limited to 'src/util/atexit.go')
-rw-r--r--src/util/atexit.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/util/atexit.go b/src/util/atexit.go
index a22a3a96..6212378b 100644
--- a/src/util/atexit.go
+++ b/src/util/atexit.go
@@ -1,7 +1,6 @@
package util
import (
- "os"
"sync"
)
@@ -25,14 +24,5 @@ func RunAtExitFuncs() {
for i := len(fns) - 1; i >= 0; i-- {
fns[i]()
}
-}
-
-// Exit executes any functions registered with AtExit() then exits the program
-// with os.Exit(code).
-//
-// NOTE: It must be used instead of os.Exit() since calling os.Exit() terminates
-// the program before any of the AtExit functions can run.
-func Exit(code int) {
- defer os.Exit(code)
- RunAtExitFuncs()
+ atExitFuncs = nil
}