From a745c0eecfbc5b958581dc502d9a3a55d1842282 Mon Sep 17 00:00:00 2001 From: mschfh <37435502+mschfh@users.noreply.github.com> Date: Wed, 8 May 2024 09:38:41 +0000 Subject: [PATCH] fix(lint): resolve golangci-lint findings --- controller/controller.go | 2 +- extension/json.go | 4 ++-- extension/xml.go | 4 ++-- server/server_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/controller/controller.go b/controller/controller.go index 835ff238..55f0433f 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -112,7 +112,7 @@ func RefreshExtensionsTicker(extensionMapUpdater func()) { } // ExtensionsRouter is the router for /extensions endpoints -func ExtensionsRouter(extensions extension.Extensions, testRouter bool) chi.Router { +func ExtensionsRouter(_ extension.Extensions, testRouter bool) chi.Router { if !testRouter { RefreshExtensionsTicker(initExtensionUpdatesFromDynamoDB) } diff --git a/extension/json.go b/extension/json.go index 3721e255..c3923b24 100644 --- a/extension/json.go +++ b/extension/json.go @@ -59,7 +59,7 @@ func (updateResponse *UpdateResponse) MarshalJSON() ([]byte, error) { app.UpdateCheck = UpdateCheck{Status: GetUpdateStatus(extension)} extensionName := "extension_" + strings.Replace(extension.Version, ".", "_", -1) + ".crx" url := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/" + extensionName - diffUrl := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/patches/" + extension.SHA256 + "/" + diffURL := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/patches/" + extension.SHA256 + "/" if app.UpdateCheck.Status == "ok" { if app.UpdateCheck.URLs == nil { app.UpdateCheck.URLs = &URLs{ @@ -83,7 +83,7 @@ func (updateResponse *UpdateResponse) MarshalJSON() ([]byte, error) { if pInfoFound { app.UpdateCheck.URLs.URLs = append(app.UpdateCheck.URLs.URLs, URL{ - CodebaseDiff: diffUrl, + CodebaseDiff: diffURL, }) pkg.NameDiff = patchInfo.Namediff pkg.DiffSHA256 = patchInfo.Hashdiff diff --git a/extension/xml.go b/extension/xml.go index e95aadf0..9860ec3e 100644 --- a/extension/xml.go +++ b/extension/xml.go @@ -7,7 +7,7 @@ import ( ) // MarshalXML encodes the extension list into response XML -func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error { +func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error { type URL struct { XMLName xml.Name `xml:"url"` Codebase string `xml:"codebase,attr"` @@ -83,7 +83,7 @@ func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, start xml.Start } // MarshalXML encodes the extension list into response XML -func (updateResponse *WebStoreUpdateResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error { +func (updateResponse *WebStoreUpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error { type UpdateCheck struct { XMLName xml.Name `xml:"updatecheck"` Status string `xml:"status,attr"` diff --git a/server/server_test.go b/server/server_test.go index 53a6edb7..dd859315 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -93,7 +93,7 @@ func testCall(t *testing.T, server *httptest.Server, method string, contentType req.Header.Add("Content-Type", contentType) client := &http.Client{ - CheckRedirect: func(req *http.Request, via []*http.Request) error { + CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }, } @@ -563,7 +563,7 @@ func TestPrintExtensions(t *testing.T) { req, err := http.NewRequest(http.MethodGet, testURL, bytes.NewBuffer([]byte(""))) assert.Nil(t, err) client := &http.Client{ - CheckRedirect: func(req *http.Request, via []*http.Request) error { + CheckRedirect: func(_ *http.Request, _ []*http.Request) error { return http.ErrUseLastResponse }, }