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
@@ -12,6 +12,7 @@ func nativePath(p string) (string, error) {
|
||||
if !strings.HasPrefix(p, "/") || path.Clean(p) != p || p == "/" {
|
||||
return "", fmt.Errorf("invalid Ceph data path %q", p)
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
||||
@@ -30,29 +31,38 @@ type mountedAccess struct{}
|
||||
func (mountedAccess) Inspect(ctx context.Context, c Config, x Executor) (*Inspection, error) {
|
||||
return inspectMounted(ctx, c, x)
|
||||
}
|
||||
|
||||
func (mountedAccess) Empty(_ context.Context, p string) error { return emptyDirectory(p) }
|
||||
|
||||
func (mountedAccess) Claim(_ context.Context, c Config, fsid, id string) (io.Closer, error) {
|
||||
return claimTarget(c.Target.Mount, fsid, c.Target, id)
|
||||
}
|
||||
|
||||
func (mountedAccess) Prepare(ctx context.Context, src, dst, scratch string) error {
|
||||
if err := clearQuotas(ctx, dst); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return hardlinkTopology(ctx, src, dst, scratch, true)
|
||||
}
|
||||
|
||||
func (mountedAccess) Apply(ctx context.Context, src, dst string) error {
|
||||
return quotas(ctx, src, dst, false)
|
||||
}
|
||||
|
||||
func (mountedAccess) Verify(ctx context.Context, src, dst, scratch string) error {
|
||||
if err := hardlinkTopology(ctx, src, dst, scratch, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return quotas(ctx, src, dst, true)
|
||||
}
|
||||
|
||||
func (e Engine) access() Access {
|
||||
if e.Access != nil {
|
||||
return e.Access
|
||||
}
|
||||
|
||||
return mountedAccess{}
|
||||
}
|
||||
|
||||
@@ -98,6 +108,7 @@ func NewEngine(ctx context.Context, c Config, x Executor, log io.Writer) (Engine
|
||||
if c.Backend == "native" {
|
||||
return openNativeEngine(ctx, c, x, log)
|
||||
}
|
||||
|
||||
return Engine{Exec: x, Log: log, Transport: Rsync{Exec: x, Log: log, BandwidthKiB: c.BandwidthKiB}}, nopCloser{}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user