mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
completed lint driven refactoring
This commit is contained in:
parent
e383e4d9b1
commit
557d7dbe17
8 changed files with 27 additions and 47 deletions
|
@ -39,7 +39,7 @@ var PromptCallbacks = map[string]func(s *Session) string{
|
|||
},
|
||||
}
|
||||
|
||||
var envRe = regexp.MustCompile("{env\\.([^}]+)}")
|
||||
var envRe = regexp.MustCompile(`{env\.([^}]+)}`)
|
||||
|
||||
type Prompt struct {
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ func NewPrompt() Prompt {
|
|||
|
||||
func (p Prompt) Render(s *Session) string {
|
||||
found, prompt := s.Env.Get(PromptVariable)
|
||||
if found == false {
|
||||
if !found {
|
||||
prompt = DefaultPrompt
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ func (p Prompt) Render(s *Session) string {
|
|||
}
|
||||
|
||||
// make sure an user error does not screw all terminal
|
||||
if strings.HasPrefix(prompt, core.RESET) == false {
|
||||
if !strings.HasPrefix(prompt, core.RESET) {
|
||||
prompt += core.RESET
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue