From eb5ed9a4b29cd53919e6a4931f83caab8c710f15 Mon Sep 17 00:00:00 2001 From: Ginny Guan Date: Mon, 26 Feb 2024 11:24:33 +0800 Subject: [PATCH] EDX-4721 Remove unused variables and function to fix lint Signed-off-by: Ginny Guan --- clients/http/utils/central.go | 9 --------- dtos/requests/provisionwatcher_test.go | 4 ---- xrtmodels/deviceInfo.go | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/clients/http/utils/central.go b/clients/http/utils/central.go index 2ab8c610..b31595c0 100644 --- a/clients/http/utils/central.go +++ b/clients/http/utils/central.go @@ -15,15 +15,6 @@ import ( "github.com/edgexfoundry/go-mod-core-contracts/v3/errors" ) -// edgeXClientReqURI returns the non-encoded path?query that would be used in an HTTP request for u. -func edgeXClientReqURI(u *url.URL) string { - result := u.Scheme + "://" + u.Host + u.Path - if u.ForceQuery || u.RawQuery != "" { - result += "?" + u.RawQuery - } - return result -} - // CentralGetRequest makes the get request and return the body func CentralGetRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, authInjector interfaces.AuthenticationInjector) errors.EdgeX { req, edgexErr := createRequest(ctx, http.MethodGet, baseUrl, requestPath, requestParams) diff --git a/dtos/requests/provisionwatcher_test.go b/dtos/requests/provisionwatcher_test.go index 4db432dd..7174e446 100644 --- a/dtos/requests/provisionwatcher_test.go +++ b/dtos/requests/provisionwatcher_test.go @@ -27,10 +27,6 @@ var testIdentifiers = map[string]string{ var testBlockingIdentifiers = map[string][]string{ "port": {"397", "398", "399"}, } -var testDeviceDescription = "test device description" -var testDeviceNamePattern = "device-name-{{Address}}-{{Port}}" -var testProfileNamePattern = "profile-name-{{Address}}-{{Port}}" -var testProfileDescription = "test profile description" var testAddProvisionWatcher = AddProvisionWatcherRequest{ BaseRequest: common.BaseRequest{ RequestId: ExampleUUID, diff --git a/xrtmodels/deviceInfo.go b/xrtmodels/deviceInfo.go index e63ebda8..43634846 100644 --- a/xrtmodels/deviceInfo.go +++ b/xrtmodels/deviceInfo.go @@ -43,7 +43,7 @@ func ToEdgeXV2Device(device DeviceInfo, serviceName string) v2models.Device { // ToEdgeXV3Device converts the XRT model to EdgeX v3 model func ToEdgeXV3Device(device DeviceInfo, serviceName string) models.Device { - for protocol, _ := range device.Protocols { + for protocol := range device.Protocols { device.Properties[common.ProtocolName] = strings.ToLower(protocol) } return models.Device{