Skip to content

Commit

Permalink
fix(lint): resolve golangci-lint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
mschfh authored May 8, 2024
1 parent 8bf86e8 commit a745c0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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
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 a745c0e

Please sign in to comment.