From 3fc88f24929b3cac6e5284bbb5701ff94b3f11e0 Mon Sep 17 00:00:00 2001 From: Matt Farina Date: Fri, 21 Aug 2020 11:51:58 -0400 Subject: [PATCH] Fixing failing CI for windows A fix introduced in #8631 caused a bug in Windows builds due to a type difference between POSIX and Windows environments. This change corrects that problem and provides a code comment to warn others. Signed-off-by: Matt Farina --- pkg/action/package.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/action/package.go b/pkg/action/package.go index 5059eee07..0a927cd41 100644 --- a/pkg/action/package.go +++ b/pkg/action/package.go @@ -135,7 +135,9 @@ func (p *Package) Clearsign(filename string) error { // promptUser implements provenance.PassphraseFetcher func promptUser(name string) ([]byte, error) { fmt.Printf("Password for key %q > ", name) - pw, err := terminal.ReadPassword(syscall.Stdin) + // syscall.Stdin is not an int in all environments and needs to be coerced + // into one there (e.g., Windows) + pw, err := terminal.ReadPassword(int(syscall.Stdin)) fmt.Println() return pw, err }