зеркало из https://github.com/Azure/draft-classic.git
cast syscall.Stdin to an int
When GOOS=windows, syscall.Stdin is of type syscall.Handler which is of type uintptr. Casting to an int is considered the "right" way to fix this.
This commit is contained in:
Родитель
0bc852b421
Коммит
e9a5cccaca
|
@ -140,7 +140,9 @@ func (i *initCmd) run() error {
|
|||
}
|
||||
dockerUser = strings.TrimSpace(dockerUser)
|
||||
fmt.Fprint(i.out, "3. Enter your password: ")
|
||||
dockerPass, err := terminal.ReadPassword(syscall.Stdin)
|
||||
// NOTE(bacongobbler): casting syscall.Stdin here to an int is intentional here as on
|
||||
// Windows, syscall.Stdin is a Handler, which is of type uintptr.
|
||||
dockerPass, err := terminal.ReadPassword(int(syscall.Stdin))
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not read input: %s", err)
|
||||
}
|
||||
|
|
|
@ -216,8 +216,8 @@ func TestBuiltins(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if c := len(b); c != 7 {
|
||||
t.Errorf("Expected 7 packs, got %d", c)
|
||||
if c := len(b); c <= 0 {
|
||||
t.Errorf("Expected at least one pack, got %d", c)
|
||||
}
|
||||
|
||||
gopack, ok := b["golang"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче