diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-09-24 18:44:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-09-24 18:44:14 +0900 |
| commit | 1c4f593566943d8a0ce16eb3cae77f8c50238202 (patch) | |
| tree | 2ac5c41a84127ff4cd5a275c81e834c495a109c9 /internal/app/process.go | |
| parent | b99c63337df4068b36d7d8de2ae79fd274172977 (diff) | |
internal/app: unexport outcome, remove app struct
The App struct no longer does anything, and the outcome struct is entirely opaque.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/process.go')
| -rw-r--r-- | internal/app/process.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/app/process.go b/internal/app/process.go index 0ee123a1..a182fa6c 100644 --- a/internal/app/process.go +++ b/internal/app/process.go @@ -22,7 +22,7 @@ import ( // duration to wait for shim to exit, after container WaitDelay has elapsed. const shimWaitTimeout = 5 * time.Second -// mainState holds persistent state bound to [Outcome.Main]. +// mainState holds persistent state bound to outcome.main. type mainState struct { // done is whether beforeExit has been called already. done bool @@ -33,7 +33,7 @@ type mainState struct { // Time is nil if no process was ever created. Time *time.Time - seal *Outcome + seal *outcome store state.Store cancel context.CancelFunc cmd *exec.Cmd @@ -218,9 +218,8 @@ func (ms mainState) fatal(fallback string, ferr error) { os.Exit(1) } -// Main commits deferred system setup, runs the container, reverts changes to the system, and terminates the program. -// Main does not return. -func (seal *Outcome) Main() { +// main carries out outcome and terminates. main does not return. +func (seal *outcome) main() { if !seal.f.CompareAndSwap(false, true) { panic("outcome: attempted to run twice") } |
