-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added mac+linux+windows support AND global build setting
- Loading branch information
1 parent
72a0bf1
commit 0efcd7a
Showing
4 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
package main | ||
|
||
import ( | ||
"syscall" | ||
|
||
"golang.org/x/term" | ||
) | ||
|
||
func readPassword() ([]byte, error) { | ||
return term.ReadPassword(int(syscall.Stdin)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build windows | ||
// +build windows | ||
|
||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"golang.org/x/sys/windows" | ||
"golang.org/x/term" | ||
) | ||
|
||
func readPassword() ([]byte, error) { | ||
return term.ReadPassword(int(windows.Handle(os.Stdin.Fd()))) | ||
} |