mirror of
https://github.com/getsops/sops.git
synced 2026-02-05 12:45:21 +01:00
Don't swallow potential errors from os.Stat.
This commit is contained in:
@@ -92,12 +92,12 @@ func (key *MasterKey) Decrypt() ([]byte, error) {
|
||||
|
||||
_, err := os.Stat(path)
|
||||
|
||||
if os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("no private key found at %s", path)
|
||||
}
|
||||
|
||||
file, err := os.Open(path)
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("no private key found at %s: %s", path, err)
|
||||
}
|
||||
|
||||
defer file.Close()
|
||||
|
||||
scanner := bufio.NewScanner(file)
|
||||
|
||||
Reference in New Issue
Block a user