fix(cli): restore int cast for syscall.Stdin on Windows

On Windows, syscall.Stdin is syscall.Handle (uintptr), not int,
so term.ReadPassword requires an explicit int() cast to compile.
This commit is contained in:
Deluan 2026-05-20 19:33:42 -03:00
parent 03ac02d964
commit e75ab3b037

View file

@ -123,14 +123,14 @@ func promptPassword() string {
for { for {
fmt.Print("Enter new password (press enter with no password to cancel): ") fmt.Print("Enter new password (press enter with no password to cancel): ")
// This cast is necessary for some platforms // This cast is necessary for some platforms
password, err := term.ReadPassword(syscall.Stdin) //nolint:unconvert password, err := term.ReadPassword(int(syscall.Stdin)) //nolint:unconvert
if err != nil { if err != nil {
log.Fatal("Error getting password", err) log.Fatal("Error getting password", err)
} }
fmt.Print("\nConfirm new password (press enter with no password to cancel): ") fmt.Print("\nConfirm new password (press enter with no password to cancel): ")
confirmation, err := term.ReadPassword(syscall.Stdin) //nolint:unconvert confirmation, err := term.ReadPassword(int(syscall.Stdin)) //nolint:unconvert
if err != nil { if err != nil {
log.Fatal("Error getting password confirmation", err) log.Fatal("Error getting password confirmation", err)