From 3b6ef77757b2cb1476d55f1ce655f4cd0446446f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Mon, 17 Mar 2025 18:02:52 -0400 Subject: [PATCH] incus-user: Fix gofumpt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/incus-user/main_daemon.go | 12 +++++++----- cmd/incus-user/server.go | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/incus-user/main_daemon.go b/cmd/incus-user/main_daemon.go index 2bc86b38d..9cab0c497 100644 --- a/cmd/incus-user/main_daemon.go +++ b/cmd/incus-user/main_daemon.go @@ -18,9 +18,11 @@ import ( "github.com/lxc/incus/v6/shared/logger" ) -var mu sync.RWMutex -var connections uint64 -var transactions uint64 +var ( + mu sync.RWMutex + connections uint64 + transactions uint64 +) var projectNames []string @@ -44,7 +46,7 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error { } // Create storage. - err := os.MkdirAll(internalUtil.VarPath("users"), 0700) + err := os.MkdirAll(internalUtil.VarPath("users"), 0o700) if err != nil && !os.IsExist(err) { return fmt.Errorf("Couldn't create storage: %w", err) } @@ -150,7 +152,7 @@ func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error { return fmt.Errorf("Unable to setup unix socket: %w", err) } - err = os.Chmod(unixPath, 0660) + err = os.Chmod(unixPath, 0o660) if err != nil { return fmt.Errorf("Unable to set socket permissions: %w", err) } diff --git a/cmd/incus-user/server.go b/cmd/incus-user/server.go index f6cccae89..83f00948d 100644 --- a/cmd/incus-user/server.go +++ b/cmd/incus-user/server.go @@ -178,7 +178,7 @@ func serverSetupUser(uid uint32) error { defer revert.Fail() // Create certificate directory. - err = os.MkdirAll(userPath, 0700) + err = os.MkdirAll(userPath, 0o700) if err != nil { return fmt.Errorf("Failed to create user directory: %w", err) }