mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
more lint driven refactoring
This commit is contained in:
parent
7919cda5ec
commit
0de6f3a76e
57 changed files with 168 additions and 241 deletions
|
@ -75,7 +75,7 @@ func (m SessionModule) ListParam(name string) (err error, values []string) {
|
|||
}
|
||||
|
||||
func (m SessionModule) StringParam(name string) (error, string) {
|
||||
if p, found := m.params[name]; found == true {
|
||||
if p, found := m.params[name]; found {
|
||||
if err, v := p.Get(m.Session); err != nil {
|
||||
return err, ""
|
||||
} else {
|
||||
|
@ -87,7 +87,7 @@ func (m SessionModule) StringParam(name string) (error, string) {
|
|||
}
|
||||
|
||||
func (m SessionModule) IntParam(name string) (error, int) {
|
||||
if p, found := m.params[name]; found == true {
|
||||
if p, found := m.params[name]; found {
|
||||
if err, v := p.Get(m.Session); err != nil {
|
||||
return err, 0
|
||||
} else {
|
||||
|
@ -136,7 +136,7 @@ func (m *SessionModule) SetRunning(running bool, cb func()) error {
|
|||
m.Started = running
|
||||
m.StatusLock.Unlock()
|
||||
|
||||
if *m.Session.Options.Debug == true {
|
||||
if *m.Session.Options.Debug {
|
||||
if running {
|
||||
m.Session.Events.Add("mod.started", m.Name)
|
||||
} else {
|
||||
|
@ -145,7 +145,7 @@ func (m *SessionModule) SetRunning(running bool, cb func()) error {
|
|||
}
|
||||
|
||||
if cb != nil {
|
||||
if running == true {
|
||||
if running {
|
||||
// this is the worker, start async
|
||||
go cb()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue