fixing lint errors

dev
mzack 2022-09-19 08:38:52 +02:00
parent 2eb2cd892a
commit 37c016a5f0
5 changed files with 10 additions and 10 deletions

View File

@ -51,7 +51,7 @@ func (r *Runner) runCloudEnumeration(store *loader.Store) (*atomic.Bool, error)
time.Sleep(3 * time.Second)
err = client.GetResults(taskID, func(re *output.ResultEvent) {
results.CAS(false, true)
results.CompareAndSwap(false, true)
if outputErr := r.output.Write(re); outputErr != nil {
gologger.Warning().Msgf("Could not write output: %s", err)

View File

@ -3,7 +3,7 @@ package nucleicloud
import (
"bytes"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"time"
@ -56,7 +56,7 @@ func (c *Client) AddScan(req *AddScanRequest) (string, error) {
return "", errors.Wrap(err, "could not do add scan request")
}
if resp.StatusCode != 200 {
data, _ := ioutil.ReadAll(resp.Body)
data, _ := io.ReadAll(resp.Body)
resp.Body.Close()
return "", errors.Errorf("could not do request %d: %s", resp.StatusCode, string(data))
}
@ -86,7 +86,7 @@ func (c *Client) GetResults(ID string, callback func(*output.ResultEvent)) error
return errors.Wrap(err, "could not do ger result request")
}
if resp.StatusCode != 200 {
data, _ := ioutil.ReadAll(resp.Body)
data, _ := io.ReadAll(resp.Body)
resp.Body.Close()
return errors.Errorf("could not do request %d: %s", resp.StatusCode, string(data))
}

View File

@ -413,7 +413,7 @@ func (r *Runner) RunEnumeration() error {
if r.interactsh != nil {
matched := r.interactsh.Close()
if matched {
results.CAS(false, true)
results.CompareAndSwap(false, true)
}
}
r.progress.Stop()

View File

@ -63,7 +63,7 @@ func (e *Engine) executeSelfContainedTemplateWithInput(template *templates.Templ
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", e.executerOpts.Colorizer.BrightBlue(template.ID), err)
}
results.CAS(false, match)
results.CompareAndSwap(false, match)
}
// executeModelWithInput executes a type of template with input
@ -144,7 +144,7 @@ func (e *Engine) executeModelWithInput(templateType types.ProtocolType, template
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", e.executerOpts.Colorizer.BrightBlue(template.ID), err)
}
results.CAS(false, match)
results.CompareAndSwap(false, match)
}(index, skip, scannedValue)
index++
@ -209,7 +209,7 @@ func (e *Engine) executeModelWithInputAndResult(templateType types.ProtocolType,
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", e.executerOpts.Colorizer.BrightBlue(template.ID), err)
}
results.CAS(false, match)
results.CompareAndSwap(false, match)
}(scannedValue)
})
wg.WaitGroup.Wait()
@ -244,7 +244,7 @@ func (e *ChildExecuter) Execute(template *templates.Template, URL string) {
if err != nil {
gologger.Warning().Msgf("[%s] Could not execute step: %s\n", e.e.executerOpts.Colorizer.BrightBlue(template.ID), err)
}
e.results.CAS(false, match)
e.results.CompareAndSwap(false, match)
wg.Done()
}(template)
}

View File

@ -71,7 +71,7 @@ func (e *Engine) runWorkflowStep(template *workflows.WorkflowTemplate, input str
}
}
if len(template.Subtemplates) == 0 {
results.CAS(false, firstMatched)
results.CompareAndSwap(false, firstMatched)
}
if len(template.Matchers) > 0 {
for _, executer := range template.Executers {