Skip to content

Commit

Permalink
Fix golint v1.33 mnd error (#1117)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiad200 authored Dec 28, 2020
1 parent 1e3f690 commit d118015
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions cloud/aws/s3inventory/parquet_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ func set(o *InventoryObject, f string, v interface{}) error {
case lastModifiedDateFieldName:
var lastModifiedMillis int64
lastModifiedMillis, err = cast.ToInt64E(v)
seconds := lastModifiedMillis / int64(time.Second/time.Millisecond)
ns := (lastModifiedMillis % 1000) * int64(time.Millisecond/time.Nanosecond)
secToMS := int64(time.Second / time.Millisecond)
seconds := lastModifiedMillis / secToMS
ns := (lastModifiedMillis % secToMS) * int64(time.Millisecond/time.Nanosecond)
o.LastModified = swag.Time(time.Unix(seconds, ns))
case eTagFieldName:
o.Checksum, err = cast.ToStringE(v)
Expand Down
5 changes: 3 additions & 2 deletions gateway/simulator/simulation_recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func (r *recordingBodyReader) Close() error {

// RECORDING

var uniquenessCounter int32 // persistent request counter during run. used only below,
var uniquenessCounter int32 // persistent request counter during run. used only below,
const counterLogMax = 100000 // The counterLogMax request will zero the logged count

func RegisterRecorder(next http.Handler, authService GatewayAuthService, region, bareDomain string) http.Handler {
logger := logging.Default()
Expand All @@ -81,7 +82,7 @@ func RegisterRecorder(next http.Handler, authService GatewayAuthService, region,
createConfFile(r, authService, region, bareDomain, recordingDir)
}
timeStr := time.Now().Format("15-04-05")
nameBase := timeStr + fmt.Sprintf("-%05d", (uniqueCount%100000))
nameBase := timeStr + fmt.Sprintf("-%05d", uniqueCount%counterLogMax)
respWriter := new(ResponseWriter)
respWriter.OriginalWriter = w
respWriter.ResponseLog = NewLazyOutput(filepath.Join(recordingDir, nameBase+ResponseExtension))
Expand Down

0 comments on commit d118015

Please sign in to comment.