Fix gosec, errorlint, and gofmt linter errors in unseal.go and grpc.go

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-03-15 10:30:18 -07:00
parent 2336bf5061
commit 33e71eeee9
3 changed files with 11 additions and 10 deletions

View File

@@ -11,9 +11,9 @@ import (
"os"
"github.com/spf13/cobra"
"golang.org/x/term"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"golang.org/x/term"
metacryptv1 "git.wntrmute.dev/kyle/metacrypt/gen/metacrypt/v1"
)
@@ -44,7 +44,7 @@ func runUnseal(cmd *cobra.Command, args []string) error {
}
fmt.Print("Unseal password: ")
passwordBytes, err := term.ReadPassword(int(os.Stdin.Fd()))
passwordBytes, err := term.ReadPassword(int(os.Stdin.Fd())) //nolint:gosec
fmt.Println()
if err != nil {
return fmt.Errorf("read password: %w", err)
@@ -59,7 +59,7 @@ func runUnseal(cmd *cobra.Command, args []string) error {
func buildTLSConfig(caCertPath string) (*tls.Config, error) {
tlsCfg := &tls.Config{MinVersion: tls.VersionTLS12}
if caCertPath != "" {
pem, err := os.ReadFile(caCertPath)
pem, err := os.ReadFile(caCertPath) //nolint:gosec
if err != nil {
return nil, fmt.Errorf("read CA cert: %w", err)
}