This website works better with JavaScript.
Home
Explore
Help
Sign In
public
/
tui
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
2
Wiki
Activity
Browse Source
Added GetPassword function.
master
jdl
2 years ago
parent
a510706310
commit
b84778e44c
2 changed files
with
10 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-0
example/simple/main.go
+6
-0
input.go
+ 4
- 0
example/simple/main.go
View File
@ -8,6 +8,10 @@ func main() {
tui
.
Start
(
)
defer
tui
.
Stop
(
)
pwd
:=
tui
.
GetPassword
(
"Password: "
)
tui
.
PrintString
(
"Got %s"
,
pwd
)
tui
.
GetString
(
"..."
)
c
:=
tui
.
GetMenu
(
"Menu"
,
"Some long or short text."
,
+ 6
- 0
input.go
View File
@ -10,6 +10,12 @@ func GetString(prompt string) string {
return
s
}
func
GetPassword
(
prompt
string
)
string
{
s
,
err
:=
t
.
ReadPassword
(
prompt
)
must
(
err
)
return
s
}
func
GetInt
(
prompt
string
)
int
{
for
{
s
:=
GetString
(
prompt
)
Write
Preview
Loading…
Cancel
Save