@@ -147,7 +147,7 @@ func splitTimeRange(start, end time.Time, splitPeriod string) [][]time.Time {
147147}
148148
149149// exportTimeRange exports audit logs for a specific time range
150- func exportTimeRange (ctx context.Context , client thalassa.Client , start , end time.Time , filter * audit.AuditLogFilter , chunkIndex int , totalChunks int , outputFile string , writeToStdout bool ) ([]audit.AuditLog , error ) {
150+ func exportTimeRange (ctx context.Context , client thalassa.Client , start , end time.Time , filter * audit.AuditLogFilter , chunkIndex int , totalChunks int , writeToStdout bool ) ([]audit.AuditLog , error ) {
151151 if ! writeToStdout && totalChunks > 1 {
152152 fmt .Printf ("Exporting chunk %d/%d: %s to %s...\n " , chunkIndex + 1 , totalChunks , start .Format (time .RFC3339 ), end .Format (time .RFC3339 ))
153153 }
@@ -198,7 +198,7 @@ func exportTimeRange(ctx context.Context, client thalassa.Client, start, end tim
198198}
199199
200200// writeExport writes the export data to a file
201- func writeExport (exportData map [string ]interface {} , outputPath string , writeToStdout bool ) error {
201+ func writeExport (exportData map [string ]any , outputPath string , writeToStdout bool ) error {
202202 var file * os.File
203203 var err error
204204
@@ -217,7 +217,7 @@ func writeExport(exportData map[string]interface{}, outputPath string, writeToSt
217217 if err != nil {
218218 return fmt .Errorf ("failed to create output file: %w" , err )
219219 }
220- defer file .Close ()
220+ defer func () { _ = file .Close () } ()
221221 }
222222
223223 encoder := json .NewEncoder (file )
@@ -386,7 +386,7 @@ Examples:
386386 chunkCtx , cancel := context .WithTimeout (cmd .Context (), timeoutDuration )
387387
388388 // Fetch logs for this chunk
389- chunkLogs , err := exportTimeRange (chunkCtx , client , chunkStart , chunkEnd , filter , i , len (chunks ), outputFile , writeToStdout )
389+ chunkLogs , err := exportTimeRange (chunkCtx , client , chunkStart , chunkEnd , filter , i , len (chunks ), writeToStdout )
390390
391391 // Always cancel the context when done with this chunk
392392 cancel ()
@@ -435,9 +435,9 @@ Examples:
435435 }
436436
437437 // Prepare export data with metadata
438- exportData := map [string ]interface {} {
438+ exportData := map [string ]any {
439439 "exportedAt" : time .Now ().Format (time .RFC3339 ),
440- "timeRange" : map [string ]interface {} {
440+ "timeRange" : map [string ]any {
441441 "type" : rangeType ,
442442 "start" : chunkStart .Format (time .RFC3339 ),
443443 "end" : chunkEnd .Format (time .RFC3339 ),
@@ -447,26 +447,26 @@ Examples:
447447 }
448448
449449 if len (chunks ) > 1 {
450- exportData ["chunk" ] = map [string ]interface {} {
450+ exportData ["chunk" ] = map [string ]any {
451451 "index" : i + 1 ,
452452 "total" : len (chunks ),
453453 }
454454 }
455455
456456 // Add custom range dates if applicable
457457 if rangeType == "custom" {
458- exportData ["timeRange" ].(map [string ]interface {} )["startDate" ] = startDate
459- exportData ["timeRange" ].(map [string ]interface {} )["endDate" ] = endDate
458+ exportData ["timeRange" ].(map [string ]any )["startDate" ] = startDate
459+ exportData ["timeRange" ].(map [string ]any )["endDate" ] = endDate
460460 }
461461
462462 // Add duration if using --since
463463 if rangeType == "duration" {
464- exportData ["timeRange" ].(map [string ]interface {} )["since" ] = sinceDuration
464+ exportData ["timeRange" ].(map [string ]any )["since" ] = sinceDuration
465465 }
466466
467467 // Add filter metadata if filters were applied
468468 if hasFilters {
469- filterMetadata := map [string ]interface {} {}
469+ filterMetadata := map [string ]any {}
470470 if searchText != "" {
471471 filterMetadata ["searchText" ] = searchText
472472 }
0 commit comments