fix: resolve errcheck, gosec, and mnd linter errors

- Fixed unhandled errors in init.go (os.Setenv/Unsetenv)
- Fixed unhandled errors in test_helpers.go (os.Setenv/Unsetenv)
- Replaced magic numbers with named constants:
  - defaultSecretLength = 16
  - mnemonicEntropyBits = 128
  - tabWriterPadding = 2
This commit is contained in:
2025-07-09 06:59:01 -07:00
parent 6e01ae6002
commit 6fe49344e2
4 changed files with 22 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ func ExecuteCommandInProcess(args []string, stdin string, env map[string]string)
// Set test environment
for k, v := range env {
os.Setenv(k, v)
_ = os.Setenv(k, v)
}
// Create root command
@@ -53,9 +53,9 @@ func ExecuteCommandInProcess(args []string, stdin string, env map[string]string)
// Restore environment
for k, v := range savedEnv {
if v == "" {
os.Unsetenv(k)
_ = os.Unsetenv(k)
} else {
os.Setenv(k, v)
_ = os.Setenv(k, v)
}
}