mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-01-06 21:47:25 +08:00
always check for errors on type casting
This commit is contained in:
parent
1f66022025
commit
35a86416aa
1 changed files with 6 additions and 1 deletions
|
|
@ -322,7 +322,12 @@ func recurseSecretKey(keys map[string]interface{}, wantedKey string) (string, er
|
|||
currentData = make(map[string]interface{})
|
||||
|
||||
for key, value := range valWithWrongType {
|
||||
currentData[key.(string)] = value
|
||||
keyStr, ok := key.(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("the key '%s' is not a string", key)
|
||||
}
|
||||
|
||||
currentData[keyStr] = value
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue