style: add blank lines between declarations and statement blocks
Separate top-level declarations and multi-line statements with blank lines, keeping an "if err != nil" check next to the statement it belongs to. Expand semicolon one-liners, group the nativeTransport fields by purpose, and format the cgo preamble as readable C. Apart from the expanded one-liners and the C preamble, the change is whitespace only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec0297fd23
commit
a6fda8f8d3
25 files changed
+929
-41
No files matched your search
@@ -35,29 +35,36 @@ func run(out io.Writer, config, root, rel, from, to string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var c struct{ Source storage.Options }
|
||||
if err = json.Unmarshal(data, &c); err != nil {
|
||||
return fmt.Errorf("config: %w", err)
|
||||
}
|
||||
|
||||
fs, err := cephfsnative.Open(c.Source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer fs.Close()
|
||||
n, err := fs.Stat(root)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = json.NewEncoder(out).Encode(n); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if from == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
d, err := fs.SnapDiff(root, rel, from, to)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defer d.Close()
|
||||
for {
|
||||
name, err := d.Next()
|
||||
@@ -67,6 +74,7 @@ func run(out io.Writer, config, root, rel, from, to string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Fprintf(out, "diff: %q\n", name)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user