diff options
author | mjarkk <mkopenga@gmail.com> | 2018-10-27 15:52:12 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-10-27 15:52:12 +0200 |
commit | 916311064059aafd13f44f7e2145b87f7e529cba (patch) | |
tree | dda9ab3ed945854072b1b83d2d4d9514ce580da0 /pkg/commands/os.go | |
parent | 6c1c110ce035544a8f1ee75fdfc1534655c31e64 (diff) |
Removed error check for regex
Regexp only returns an error when regex string is in-corret
Diffstat (limited to 'pkg/commands/os.go')
-rw-r--r-- | pkg/commands/os.go | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 844f36214..88e4f52cd 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -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 = "" |