Skip to content

Commit

Permalink
fix: fixing lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Aug 27, 2024
1 parent 8764569 commit 68a254d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (b *LyticsBulkUploader) createCSVFile(existingFilePath string, streamTraits
return actionFile, nil

Check warning on line 233 in router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go

View check run for this annotation

Codecov / codecov/patch

router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go#L233

Added line #L233 was not covered by tests
}

func convertGjsonToStreamTraitMapping(result gjson.Result) ([]StreamTraitMapping, error) {
func convertGjsonToStreamTraitMapping(result gjson.Result) []StreamTraitMapping {
var mappings []StreamTraitMapping

Check warning on line 237 in router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go

View check run for this annotation

Codecov / codecov/patch

router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go#L236-L237

Added lines #L236 - L237 were not covered by tests

// Iterate through the array in the result
Expand All @@ -246,7 +246,7 @@ func convertGjsonToStreamTraitMapping(result gjson.Result) ([]StreamTraitMapping
return true // Continue iteration
})

Check warning on line 247 in router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go

View check run for this annotation

Codecov / codecov/patch

router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go#L245-L247

Added lines #L245 - L247 were not covered by tests

return mappings, nil
return mappings

Check warning on line 249 in router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go

View check run for this annotation

Codecov / codecov/patch

router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go#L249

Added line #L249 was not covered by tests
}

func (e *LyticsBulkUploader) MakeHTTPRequest(data *HttpRequestData) ([]byte, int, error) {
Expand Down Expand Up @@ -310,7 +310,7 @@ func (b *LyticsBulkUploader) Upload(asyncDestStruct *common.AsyncDestinationStru
var successJobs []int64

Check warning on line 310 in router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go

View check run for this annotation

Codecov / codecov/patch

router/batchrouter/asyncdestinationmanager/lytics_bulk_upload/lyticsBulkUpload.go#L309-L310

Added lines #L309 - L310 were not covered by tests

destConfigJson := string(destConfig)
streamTraitsMapping, err := convertGjsonToStreamTraitMapping(gjson.Get(destConfigJson, "streamTraitsMapping"))
streamTraitsMapping := convertGjsonToStreamTraitMapping(gjson.Get(destConfigJson, "streamTraitsMapping"))
if err != nil {
return common.AsyncUploadOutput{
FailedJobIDs: append(asyncDestStruct.FailedJobIDs, asyncDestStruct.ImportingJobIDs...),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ func TestHttpClientDoSuccess(t *testing.T) {
resp, err := mockHttpClient.Do(req)
assert.NoError(t, err)
assert.Equal(t, expectedResp, resp)

if resp.Body != nil {
defer resp.Body.Close()
}
}

func TestPollerPollSuccess(t *testing.T) {
Expand Down

0 comments on commit 68a254d

Please sign in to comment.