From 90ab2f7c893da42a80159babb448d09a4115be57 Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Thu, 14 Mar 2024 16:06:50 +0300 Subject: [PATCH] Fix linters --- management/server/http/posture_checks_handler.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/management/server/http/posture_checks_handler.go b/management/server/http/posture_checks_handler.go index 6ea84ea26..9aa75bc1a 100644 --- a/management/server/http/posture_checks_handler.go +++ b/management/server/http/posture_checks_handler.go @@ -352,11 +352,10 @@ func toPostureChecksResponse(postureChecks *posture.Checks) *api.PostureCheck { func toGeoLocationCheckResponse(geoLocationCheck *posture.GeoLocationCheck) *api.GeoLocationCheck { locations := make([]api.Location, 0, len(geoLocationCheck.Locations)) - for _, loc := range geoLocationCheck.Locations { - l := loc // make G601 happy + for i, loc := range geoLocationCheck.Locations { var cityName *string if loc.CityName != "" { - cityName = &l.CityName + cityName = &geoLocationCheck.Locations[i].CityName } locations = append(locations, api.Location{ CityName: cityName, @@ -419,10 +418,10 @@ func toPeerNetworkRangeCheck(check *api.PeerNetworkRangeCheck) (*posture.PeerNet func toProcessCheckResponse(check *posture.ProcessCheck) *api.ProcessCheck { processes := make([]api.Process, 0, len(check.Processes)) - for _, process := range check.Processes { + for i := range check.Processes { processes = append(processes, api.Process{ - Path: &process.Path, - WindowsPath: &process.WindowsPath, + Path: &check.Processes[i].Path, + WindowsPath: &check.Processes[i].WindowsPath, }) }