mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-15 05:53:15 +00:00
Merge pull request #54059 from porridge/fix-lint-err
Automatic merge from submit-queue (batch tested with PRs 53696, 54059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix lint warnings for useless err checks. **What this PR does / why we need it**: This check was recently added to golint. **Which issue this PR fixes** Related to #37254 **Release note**: ```release-note NONE ``` Kubernetes-commit: a1e786f1389d7a15a7548afa8015331027717b32
This commit is contained in:
commit
71d5cae011
@ -66,10 +66,7 @@ func WriteCert(certPath string, data []byte) error {
|
|||||||
if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil {
|
if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := ioutil.WriteFile(certPath, data, os.FileMode(0644)); err != nil {
|
return ioutil.WriteFile(certPath, data, os.FileMode(0644))
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteKey writes the pem-encoded key data to keyPath.
|
// WriteKey writes the pem-encoded key data to keyPath.
|
||||||
@ -80,10 +77,7 @@ func WriteKey(keyPath string, data []byte) error {
|
|||||||
if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil {
|
if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := ioutil.WriteFile(keyPath, data, os.FileMode(0600)); err != nil {
|
return ioutil.WriteFile(keyPath, data, os.FileMode(0600))
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadOrGenerateKeyFile looks for a key in the file at the given path. If it
|
// LoadOrGenerateKeyFile looks for a key in the file at the given path. If it
|
||||||
|
Loading…
Reference in New Issue
Block a user