aboutsummaryrefslogtreecommitdiff
path: root/weed/command/admin.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-07-16 23:39:27 -0700
committerGitHub <noreply@github.com>2025-07-16 23:39:27 -0700
commit69553e5ba6d46ed924b0c3adc3f8d9666550999a (patch)
tree7711c4d9fe1919d2c6eaa841779bcde6e24b0248 /weed/command/admin.go
parenta524b4f485ce5aa2f234c742bd7d1e75386f569b (diff)
downloadseaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.tar.xz
seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.zip
convert error fromating to %w everywhere (#6995)
Diffstat (limited to 'weed/command/admin.go')
-rw-r--r--weed/command/admin.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/command/admin.go b/weed/command/admin.go
index 31d4ed087..6ac42330c 100644
--- a/weed/command/admin.go
+++ b/weed/command/admin.go
@@ -186,7 +186,7 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
sessionKeyBytes := make([]byte, 32)
_, err := rand.Read(sessionKeyBytes)
if err != nil {
- return fmt.Errorf("failed to generate session key: %v", err)
+ return fmt.Errorf("failed to generate session key: %w", err)
}
store := cookie.NewStore(sessionKeyBytes)
r.Use(sessions.Sessions("admin-session", store))
@@ -234,7 +234,7 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
// Start worker gRPC server for worker connections
err = adminServer.StartWorkerGrpcServer(*options.port)
if err != nil {
- return fmt.Errorf("failed to start worker gRPC server: %v", err)
+ return fmt.Errorf("failed to start worker gRPC server: %w", err)
}
// Set up cleanup for gRPC server
@@ -304,7 +304,7 @@ func startAdminServer(ctx context.Context, options AdminOptions) error {
defer cancel()
if err := server.Shutdown(shutdownCtx); err != nil {
- return fmt.Errorf("admin server forced to shutdown: %v", err)
+ return fmt.Errorf("admin server forced to shutdown: %w", err)
}
return nil
@@ -328,7 +328,7 @@ func expandHomeDir(path string) (string, error) {
// Get current user
currentUser, err := user.Current()
if err != nil {
- return "", fmt.Errorf("failed to get current user: %v", err)
+ return "", fmt.Errorf("failed to get current user: %w", err)
}
// Handle different tilde patterns