1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Removed error check for regex

Regexp only returns an error when regex string is in-corret
This commit is contained in:
mjarkk
2018-10-27 15:52:12 +02:00
parent 6c1c110ce0
commit 9163110640

View File

@ -71,10 +71,7 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
ttyText = ttyText + " " + word
// detect username question
detectUname, err := regexp.MatchString(`Username\s*for\s*'.+':`, ttyText)
if err != nil {
return "-"
}
detectUname, _ := regexp.MatchString(`Username\s*for\s*'.+':`, ttyText)
if detectUname {
// reset the text and return the user's username
ttyText = ""
@ -82,10 +79,7 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
}
// detect password question
detectPass, err := regexp.MatchString(`Password\s*for\s*'.+':`, ttyText)
if err != nil {
return "-"
}
detectPass, _ := regexp.MatchString(`Password\s*for\s*'.+':`, ttyText)
if detectPass {
// reset the text and return the user's username
ttyText = ""