diff options
| author | ewy <ewy0@protonmail.com> | 2026-06-06 20:20:41 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-06-06 20:20:41 +0200 |
| commit | fc9d57a500e522ce254f34681c67c6b2f3300cd8 (patch) | |
| tree | 101a9993e10c981a040f8321908e81e92371bbbd /spool/exit.go | |
| parent | a51c16ec4a1470549e3070d62a71386ea1aa5431 (diff) | |
remove a bunch of unnecessary pointer manip
Diffstat (limited to 'spool/exit.go')
| -rw-r--r-- | spool/exit.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spool/exit.go b/spool/exit.go index 23cf9da..77bff44 100644 --- a/spool/exit.go +++ b/spool/exit.go @@ -35,7 +35,7 @@ var ( var Codes []ExitCode var CodeMap = make(map[int]*ExitCode) -func New(num int, message string) ExitCode { +func New(num int, message string) *ExitCode { if CodeMap[num] != nil && num != 0 { _, _ = Warn("redefined error code: %v", num) } @@ -45,14 +45,14 @@ func New(num int, message string) ExitCode { } Codes = append(Codes, c) CodeMap[num] = &c - return c + return &c } -func (e ExitCode) Exit() { +func (e *ExitCode) Exit() { os.Exit(e.Value) } -func (e ExitCode) Next(message string) ExitCode { +func (e *ExitCode) Next(message string) *ExitCode { return New( e.Value+1, message, |
