Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to io/ioutil package #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

austinvazquez
Copy link
Contributor

Package io/ioutil has been marked deprecated in Go 1.16.

Signed-off-by: Austin Vazquez [email protected]

@austinvazquez austinvazquez marked this pull request as ready for review November 10, 2022 05:58
.golangci.yml Outdated Show resolved Hide resolved
Package io/ioutil has been marked deprecated in Go 1.16.

Signed-off-by: Austin Vazquez <[email protected]>
@austinvazquez austinvazquez force-pushed the remove-ioutil branch 3 times, most recently from ebe8038 to 85dd95c Compare February 22, 2023 18:01
Comment on lines +186 to +188
if err != nil {
return nil, fmt.Errorf("failed to get snapshot %s from storage: %w", key, err)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves ineffectual assignment of err. If storage.GetSnapshot call fails then s == snapshots.Snapshot{} or empty snapshot struct. From my read it made sense to propagate the error here instead of continuing and attempting to mount an empty snapshot. Lmk your thoughts.

@@ -182,9 +181,12 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er
if err != nil {
return nil, err
}
defer t.Rollback()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved just for readability / matches the standard practice of other functions in this snapshotter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be another PR

@austinvazquez
Copy link
Contributor Author

@AkihiroSuda, I removed some not required changes if you would take a second look. Enabling errcheck could probably be its own PR as most of its warnings are around checking of rollback errors on non-writable transactions which is unlikely to fail.

env:
GO111MODULE: on
GO_VERSION: 1.20.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define env

@@ -5,6 +5,10 @@ on:
push:
branches:
- master

env:
GO_VERSION: 1.20.x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define env

@AkihiroSuda
Copy link
Member

Sorry, overlooked this, needs rebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants