Skip to content

Commit b0b2584

Browse files
committed
remove nolint comments
There only were a few, and most could be addressed by suppressing the unhandled errors. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 7c4274b commit b0b2584

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

zfs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (s *snapshotter) Stat(ctx context.Context, key string) (snapshots.Info, err
107107
if err != nil {
108108
return snapshots.Info{}, err
109109
}
110-
defer t.Rollback() //nolint:errcheck
110+
defer func() { _ = t.Rollback() }()
111111
_, info, _, err := storage.GetInfo(ctx, key)
112112
if err != nil {
113113
return snapshots.Info{}, err
@@ -127,7 +127,7 @@ func (s *snapshotter) usage(ctx context.Context, key string) (snapshots.Usage, e
127127
return snapshots.Usage{}, err
128128
}
129129
id, info, usage, err := storage.GetInfo(ctx, key)
130-
t.Rollback() //nolint:errcheck
130+
_ = t.Rollback()
131131

132132
if err != nil {
133133
return snapshots.Usage{}, err
@@ -159,7 +159,7 @@ func (s *snapshotter) Walk(ctx context.Context, fn snapshots.WalkFunc, filters .
159159
if err != nil {
160160
return err
161161
}
162-
defer t.Rollback() //nolint:errcheck
162+
defer func() { _ = t.Rollback() }()
163163
return storage.WalkInfo(ctx, fn, filters...)
164164
}
165165

@@ -288,7 +288,7 @@ func (s *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er
288288
return nil, err
289289
}
290290
snapshot, err := storage.GetSnapshot(ctx, key)
291-
t.Rollback() //nolint:errcheck
291+
_ = t.Rollback()
292292
if err != nil {
293293
return nil, fmt.Errorf("failed to get active snapshot: %w", err)
294294
}
@@ -352,7 +352,7 @@ func (s *snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpath
352352

353353
info, err = storage.UpdateInfo(ctx, info, fieldpaths...)
354354
if err != nil {
355-
t.Rollback() //nolint:errcheck
355+
_ = t.Rollback()
356356
return snapshots.Info{}, err
357357
}
358358

zfs_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestZFSUsage(t *testing.T) {
108108
if err != nil {
109109
t.Error(err)
110110
}
111-
defer closer() //nolint:errcheck
111+
defer func() { _ = closer() }()
112112

113113
// Prepare empty base layer
114114
target := filepath.Join(root, "prepare-1")

0 commit comments

Comments
 (0)