aboutsummaryrefslogtreecommitdiff
path: root/metadata
diff options
context:
space:
mode:
authorJoseph Richey <joerichey94@gmail.com>2018-02-11 23:56:49 -0800
committerJoseph Richey <joerichey94@gmail.com>2018-02-11 23:56:49 -0800
commit69630f37fcebe894b15872148bd8b2496806b60c (patch)
tree1ae1ed02acba2c9beef4a81652d5594c67cf60e6 /metadata
parent1f508cc30f3c1caadea5c648158880eacfe9b113 (diff)
vet: eliminate unnecessary shadowing
Running "go vet -shadow ./..." finds all places where a variable might be incorrectly or unnecessarily shadowed. This fixes some of them.
Diffstat (limited to 'metadata')
-rw-r--r--metadata/policy.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/metadata/policy.go b/metadata/policy.go
index 533d48a..ce40f9c 100644
--- a/metadata/policy.go
+++ b/metadata/policy.go
@@ -86,7 +86,7 @@ func GetPolicy(path string) (*PolicyData, error) {
defer file.Close()
var policy unix.FscryptPolicy
- if err := policyIoctl(file, unix.FS_IOC_GET_ENCRYPTION_POLICY, &policy); err != nil {
+ if err = policyIoctl(file, unix.FS_IOC_GET_ENCRYPTION_POLICY, &policy); err != nil {
return nil, errors.Wrapf(err, "get encryption policy %s", path)
}
@@ -119,7 +119,7 @@ func SetPolicy(path string, data *PolicyData) error {
}
defer file.Close()
- if err := data.CheckValidity(); err != nil {
+ if err = data.CheckValidity(); err != nil {
return errors.Wrap(err, "invalid policy")
}