Skip to content

Commit

Permalink
resolve lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Assassin718 committed Oct 25, 2024
1 parent 5d777a6 commit 63e7e26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/engine/trigger/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func GenerateRandomNginxLogToFile(ctx context.Context, speed, totalTime int, pat
timeout := time.After(time.Minute * time.Duration(totalTime))

timePre := time.Now()
var bytes int64 = 0
var bytes int64

for {
select {
Expand All @@ -38,7 +38,7 @@ func GenerateRandomNginxLogToFile(ctx context.Context, speed, totalTime int, pat
return ctx, nil
default:
timeNow := time.Now()
bytes += int64(timeNow.Sub(timePre).Microseconds() * int64(speed))
bytes += timeNow.Sub(timePre).Microseconds() * int64(speed)
for bytes > int64(len(nginxLog)) {
_, _ = file.WriteString(nginxLog + "\n") // #nosec G307
bytes -= int64(len(nginxLog))
Expand Down

0 comments on commit 63e7e26

Please sign in to comment.