Skip to content

Commit 19a93b0

Browse files
committed
refactor(input): simplify echoMode
Signed-off-by: Carlos Alexandro Becker <[email protected]>
1 parent e095a91 commit 19a93b0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

input/command.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package input
22

33
import (
44
"fmt"
5-
65
"os"
76

87
"github.com/charmbracelet/bubbles/key"
@@ -34,12 +33,9 @@ func (o Options) Run() error {
3433
keymap := huh.NewDefaultKeyMap()
3534
keymap.Quit = key.NewBinding(key.WithKeys("ctrl+c", "esc"))
3635

37-
var echoMode huh.EchoMode
38-
36+
echoMode := huh.EchoModeNormal
3937
if o.Password {
4038
echoMode = huh.EchoModePassword
41-
} else {
42-
echoMode = huh.EchoModeNormal
4339
}
4440

4541
err := huh.NewForm(
@@ -60,7 +56,6 @@ func (o Options) Run() error {
6056
WithShowHelp(o.ShowHelp).
6157
WithProgramOptions(tea.WithOutput(os.Stderr)).
6258
Run()
63-
6459
if err != nil {
6560
return err
6661
}

0 commit comments

Comments
 (0)