Skip to content

Commit

Permalink
Merge branch 'master' into mschfh-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mschfh authored May 8, 2024
2 parents aa98325 + bacba3e commit 1f44851
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions extension/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions extension/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
}
Expand Down Expand Up @@ -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
},
}
Expand Down

0 comments on commit 1f44851

Please sign in to comment.