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:
@ -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 = ""
|
||||
|
Reference in New Issue
Block a user