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/go.mod b/go.mod index 6c4a2cd9..67a29315 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/brave/go-update go 1.21 require ( - github.com/aws/aws-sdk-go v1.52.1 + github.com/aws/aws-sdk-go v1.52.2 github.com/brave-intl/bat-go v0.1.0 github.com/getsentry/sentry-go v0.27.0 github.com/go-chi/chi v4.1.2+incompatible diff --git a/go.sum b/go.sum index de3c138d..6d0d9307 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/aws/aws-sdk-go v1.51.30 h1:RVFkjn9P0JMwnuZCVH0TlV5k9zepHzlbc4943eZMhG github.com/aws/aws-sdk-go v1.51.30/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go v1.52.1 h1:pYpPIuvVsawYDR0Nt3VrceizUAbtpTN3Z7xBzcZWwfI= github.com/aws/aws-sdk-go v1.52.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.52.2 h1:l4g9wBXRBlvCtScvv4iLZCzLCtR7BFJcXOnOGQ20orw= +github.com/aws/aws-sdk-go v1.52.2/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/brave-intl/bat-go v0.1.0 h1:MnxS10+xgCIfTsb7yNSv4roPNM15ISyC0mWt5buR8Ys= 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 }, }