From a3f919c3756105ff92023c82241e31f8df7b94ec Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Sun, 19 Jul 2026 21:01:17 +0200 Subject: [PATCH 1/2] fix(cmd): use portable os.Stdin.Fd for password read on Windows (follow-up to #1279) term.ReadPassword takes an int, but syscall.Stdin is an int only on Unix; on Windows it is a syscall.Handle (uintptr), so cmd/configure_azure.go failed to compile under GOOS=windows. Use int(os.Stdin.Fd()), which is portable across platforms, and drop the now-unused syscall import. Addresses the unresolved CodeRabbit review thread on #1279. Verified that the prior code fails `GOOS=windows go build ./cmd/...` with a type error and the fix builds cleanly for both host and windows/amd64. --- cmd/configure_azure.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/configure_azure.go b/cmd/configure_azure.go index 8f442d7bc..55dc9dfce 100644 --- a/cmd/configure_azure.go +++ b/cmd/configure_azure.go @@ -12,7 +12,6 @@ import ( "os/exec" "regexp" "strings" - "syscall" "time" @@ -273,7 +272,10 @@ func promptForAzureCredentialFields(reader *bufio.Reader, creds *AzureCredential if creds.ClientSecret == "" { fmt.Print("Client Secret (password): ") - secret, err := term.ReadPassword(syscall.Stdin) + // int(os.Stdin.Fd()) is portable: syscall.Stdin is an int on Unix but a + // Handle on Windows, so passing it to term.ReadPassword (which takes an + // int) breaks GOOS=windows builds. + secret, err := term.ReadPassword(int(os.Stdin.Fd())) if err != nil { return fmt.Errorf("failed to read secret: %w", err) } From 6d7478524ad71edfb4efb4fa255874231c486a61 Mon Sep 17 00:00:00 2001 From: Cristian Magherusan-Stanciu Date: Sun, 19 Jul 2026 22:34:28 +0200 Subject: [PATCH 2/2] fix(cmd): justify terminal descriptor conversion --- cmd/configure_azure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/configure_azure.go b/cmd/configure_azure.go index 55dc9dfce..900fb345c 100644 --- a/cmd/configure_azure.go +++ b/cmd/configure_azure.go @@ -275,7 +275,7 @@ func promptForAzureCredentialFields(reader *bufio.Reader, creds *AzureCredential // int(os.Stdin.Fd()) is portable: syscall.Stdin is an int on Unix but a // Handle on Windows, so passing it to term.ReadPassword (which takes an // int) breaks GOOS=windows builds. - secret, err := term.ReadPassword(int(os.Stdin.Fd())) + secret, err := term.ReadPassword(int(os.Stdin.Fd())) // #nosec G115 -- OS file descriptors fit in int on every supported platform if err != nil { return fmt.Errorf("failed to read secret: %w", err) }