aboutsummaryrefslogtreecommitdiff
path: root/attack_result.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-01-25 19:32:48 +0700
committerShulhan <ms@kilabit.info>2024-01-25 19:45:46 +0700
commit099ccef4614d8b3ba19f44c50ef984631d161240 (patch)
treea31565d4ec4cc911735c086c35da8d89d689ac3e /attack_result.go
parent7d3ce2ca01f2d4954d89430e48ca23c89416668b (diff)
downloadgorankusu-099ccef4614d8b3ba19f44c50ef984631d161240.tar.xz
all: fix warnings recommended by linter revive
Most of the fixes related to naming variables with acronyms, for example HTTP, JSON, URL, and so on.
Diffstat (limited to 'attack_result.go')
-rw-r--r--attack_result.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/attack_result.go b/attack_result.go
index 26f1a9d..4902885 100644
--- a/attack_result.go
+++ b/attack_result.go
@@ -32,7 +32,7 @@ type AttackResult struct {
hist *vegeta.Histogram
TargetID string // ID of Target.
- HttpTargetID string // ID of HTTP target which own the result.
+ HTTPTargetID string // ID of HTTP target which own the result.
Name string // Name of output file without path.
fullpath string
@@ -49,13 +49,13 @@ func newAttackResult(env *Environment, rr *RunRequest) (
logp := "newAttackResult"
ar = &AttackResult{
TargetID: rr.Target.ID,
- HttpTargetID: rr.HttpTarget.ID,
+ HTTPTargetID: rr.HTTPTarget.ID,
metrics: &vegeta.Metrics{},
hist: &vegeta.Histogram{},
}
ar.Name = fmt.Sprintf("%s.%s.%s.%dx%s.%s.bin",
- rr.Target.ID, rr.HttpTarget.ID,
+ rr.Target.ID, rr.HTTPTarget.ID,
time.Now().Format(outputSuffixDate),
rr.Target.Opts.RatePerSecond, rr.Target.Opts.Duration,
env.ResultsSuffix)
@@ -99,14 +99,14 @@ func (ar *AttackResult) cancel() {
if ar.fout != nil {
err := ar.fout.Close()
if err != nil {
- mlog.Errf(`AttackResult.cancel %s: %s`, ar.HttpTargetID, err)
+ mlog.Errf(`AttackResult.cancel %s: %s`, ar.HTTPTargetID, err)
}
ar.fout = nil
if len(ar.fullpath) > 0 {
err = os.Remove(ar.fullpath)
if err != nil {
- mlog.Errf(`AttackResult.cancel %s: %s`, ar.HttpTargetID, err)
+ mlog.Errf(`AttackResult.cancel %s: %s`, ar.HTTPTargetID, err)
}
}
}
@@ -126,7 +126,7 @@ func (ar *AttackResult) finish() (err error) {
if ar.fout != nil {
err = ar.fout.Close()
if err != nil {
- return fmt.Errorf("%s: %w", ar.HttpTargetID, err)
+ return fmt.Errorf(`%s: %w`, ar.HTTPTargetID, err)
}
ar.fout = nil
}