mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-02 14:10:32 +08:00
Enable profiling options when 'pprof' tag is set (#2813)
This commit enables cpu, mem, block, and mutex profling of the FZF executable. To support flushing the profiles at program exit it adds util.AtExit to register "at exit" functions and mandates that util.Exit is used instead of os.Exit to stop the program. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
This commit is contained in:
co-authored by
Junegunn Choi
parent
892d1acccb
commit
3c877c504b
@@ -58,7 +58,7 @@ func openTtyIn() *os.File {
|
||||
}
|
||||
}
|
||||
fmt.Fprintln(os.Stderr, "Failed to open "+consoleDevice)
|
||||
os.Exit(2)
|
||||
util.Exit(2)
|
||||
}
|
||||
return in
|
||||
}
|
||||
|
||||
+1
-1
@@ -678,7 +678,7 @@ func NoColorTheme() *ColorTheme {
|
||||
|
||||
func errorExit(message string) {
|
||||
fmt.Fprintln(os.Stderr, message)
|
||||
os.Exit(2)
|
||||
util.Exit(2)
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user