From 87b5c30ef6d5b7b8a10d6a5a8610054c403923e6 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 9 Oct 2025 05:04:08 +0900 Subject: message: relocate from container This package is quite useful. This change allows it to be imported without importing container. Signed-off-by: Ophestra --- internal/app/process.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'internal/app/process.go') diff --git a/internal/app/process.go b/internal/app/process.go index 32254969..0962e212 100644 --- a/internal/app/process.go +++ b/internal/app/process.go @@ -17,6 +17,7 @@ import ( "hakurei.app/hst" "hakurei.app/internal" "hakurei.app/internal/app/state" + "hakurei.app/message" "hakurei.app/system" ) @@ -40,7 +41,7 @@ type mainState struct { cmdWait chan error k *outcome - container.Msg + message.Msg uintptr } @@ -207,7 +208,7 @@ func (ms mainState) fatal(fallback string, ferr error) { } // main carries out outcome and terminates. main does not return. -func (k *outcome) main(msg container.Msg) { +func (k *outcome) main(msg message.Msg) { if !k.active.CompareAndSwap(false, true) { panic("outcome: attempted to run twice") } @@ -312,10 +313,10 @@ func (k *outcome) main(msg container.Msg) { os.Exit(0) } -// printMessageError prints the error message according to [container.GetErrorMessage], +// printMessageError prints the error message according to [message.GetMessage], // or fallback prepended to err if an error message is not available. func printMessageError(fallback string, err error) { - m, ok := container.GetErrorMessage(err) + m, ok := message.GetMessage(err) if !ok { log.Println(fallback, err) return -- cgit v1.3.1