[client] Fix staticcheck findings from the updated golangci-lint (#7266)

* Fix staticcheck findings reported by the updated golangci-lint

* Skip the receive error log when the local context is done
This commit is contained in:
Viktor Liu
2026-08-20 16:50:50 +02:00
committed by GitHub
parent e206f8827d
commit e4b8bf39d2
14 changed files with 37 additions and 34 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ func WriteBytesWithRestrictedPermission(ctx context.Context, file string, bs []b
return fmt.Errorf("enforce permission: %w", err)
}
return writeBytes(ctx, file, err, configDir, configFileName, bs)
return writeBytes(ctx, file, configDir, configFileName, bs)
}
// WriteJsonWithRestrictedPermission writes JSON config object to a file. Enforces permission on the parent directory
@@ -106,10 +106,10 @@ func writeJson(ctx context.Context, file string, obj interface{}, configDir stri
return fmt.Errorf("marshal: %w", err)
}
return writeBytes(ctx, file, err, configDir, configFileName, bs)
return writeBytes(ctx, file, configDir, configFileName, bs)
}
func writeBytes(ctx context.Context, file string, err error, configDir string, configFileName string, bs []byte) error {
func writeBytes(ctx context.Context, file string, configDir string, configFileName string, bs []byte) error {
if ctx.Err() != nil {
return fmt.Errorf("write bytes start: %w", ctx.Err())
}