fileperms: newer Go 1.13+ octal literal format

Problem: While removing cgroupsv1 code, I noticed my neovim Go config
automatically changed fileperms to the new octal format and I didn't
want that polluting my diffs.

Decision: I thought it best to switch to the new octal format in a dedicated PR.

Action:
- Cursor switched to new octal format for all fileperm ocurrences in Go
 source and test files.
- vendor/, docs/ and non-Go files were ignored.
- Reviewed manually.

Ref: https://go.dev/ref/spec#Go_1.13

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar
2025-10-15 09:39:18 -04:00
parent ab7abbab67
commit 74788a3fe1
94 changed files with 382 additions and 382 deletions

View File

@@ -506,7 +506,7 @@ func WriteJSONFile(data []byte, filePath string) error {
if err != nil {
return err
}
return os.WriteFile(filePath, formatJSON, 0644)
return os.WriteFile(filePath, formatJSON, 0o644)
}
// Containerized check the podman command run inside container
@@ -553,7 +553,7 @@ func savePublicKey(fileName string, publicKey *rsa.PublicKey) (string, error) {
// Write public key to file
publicKeyFileName := fileName + ".rsa.pub"
if err := os.WriteFile(publicKeyFileName, pubPEM, 0600); err != nil {
if err := os.WriteFile(publicKeyFileName, pubPEM, 0o600); err != nil {
return "", err
}
@@ -575,7 +575,7 @@ func savePrivateKey(fileName string, privateKey *rsa.PrivateKey) (string, error)
// Write private key to file
privateKeyFileName := fileName + ".rsa"
if err := os.WriteFile(privateKeyFileName, keyPEM, 0600); err != nil {
if err := os.WriteFile(privateKeyFileName, keyPEM, 0o600); err != nil {
return "", err
}