diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-16 17:26:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-16 18:51:53 +0900 |
| commit | e599b5583dd821ed26bdfc01f7f67d4a317b9843 (patch) | |
| tree | b444a3dc964814360e6779bc10b30f2e599b537c /helper/proc | |
| parent | 33a4ab11c226c736c0d8b2644fbbe27a5ca045e9 (diff) | |
fmsg: implement suspend in writer
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/proc')
| -rw-r--r-- | helper/proc/self.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/helper/proc/self.go b/helper/proc/self.go deleted file mode 100644 index 6dc92eb7..00000000 --- a/helper/proc/self.go +++ /dev/null @@ -1,26 +0,0 @@ -package proc - -import ( - "os" - "sync" - - "git.gensokyo.uk/security/fortify/internal/fmsg" -) - -var ( - executable string - executableOnce sync.Once -) - -func copyExecutable() { - if name, err := os.Executable(); err != nil { - fmsg.Fatalf("cannot read executable path: %v", err) - } else { - executable = name - } -} - -func MustExecutable() string { - executableOnce.Do(copyExecutable) - return executable -} |
