From a9cab98afcd8e46c38624787d4af390f6287da53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Fri, 19 Dec 2025 01:52:27 -0500 Subject: [PATCH] incus-agent: Code cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incus-agent/daemon.go | 3 ++- cmd/incus-agent/main.go | 2 ++ cmd/incus-agent/main_agent.go | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/incus-agent/daemon.go b/cmd/incus-agent/daemon.go index 2ab4997dd..7979f9631 100644 --- a/cmd/incus-agent/daemon.go +++ b/cmd/incus-agent/daemon.go @@ -8,9 +8,10 @@ import ( // A Daemon can respond to requests from a shared client. type Daemon struct { - // Event servers + // Event servers. events *events.Server + // Paths. secretsLocation string // ContextID and port of the host socket server. diff --git a/cmd/incus-agent/main.go b/cmd/incus-agent/main.go index c574206e2..9e018f9ba 100644 --- a/cmd/incus-agent/main.go +++ b/cmd/incus-agent/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "runtime" @@ -48,6 +49,7 @@ func main() { // Run the main command and handle errors err := app.Execute() if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } } diff --git a/cmd/incus-agent/main_agent.go b/cmd/incus-agent/main_agent.go index 8f189c925..e2f281776 100644 --- a/cmd/incus-agent/main_agent.go +++ b/cmd/incus-agent/main_agent.go @@ -47,8 +47,7 @@ func (c *cmdAgent) Command() *cobra.Command { func (c *cmdAgent) Run(cmd *cobra.Command, args []string) error { if c.global.flagService { - err := runService("Incus-Agent", c) - return err + return runService("Incus-Agent", c) } // Setup logger.