Skip to content

Commit bacba3e

Browse files
authored
fix(lint): resolve golangci-lint findings (#184)
1 parent 8bf86e8 commit bacba3e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

controller/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func RefreshExtensionsTicker(extensionMapUpdater func()) {
112112
}
113113

114114
// ExtensionsRouter is the router for /extensions endpoints
115-
func ExtensionsRouter(extensions extension.Extensions, testRouter bool) chi.Router {
115+
func ExtensionsRouter(_ extension.Extensions, testRouter bool) chi.Router {
116116
if !testRouter {
117117
RefreshExtensionsTicker(initExtensionUpdatesFromDynamoDB)
118118
}

extension/json.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (updateResponse *UpdateResponse) MarshalJSON() ([]byte, error) {
5959
app.UpdateCheck = UpdateCheck{Status: GetUpdateStatus(extension)}
6060
extensionName := "extension_" + strings.Replace(extension.Version, ".", "_", -1) + ".crx"
6161
url := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/" + extensionName
62-
diffUrl := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/patches/" + extension.SHA256 + "/"
62+
diffURL := "https://" + GetS3ExtensionBucketHost(extension.ID) + "/release/" + extension.ID + "/patches/" + extension.SHA256 + "/"
6363
if app.UpdateCheck.Status == "ok" {
6464
if app.UpdateCheck.URLs == nil {
6565
app.UpdateCheck.URLs = &URLs{
@@ -83,7 +83,7 @@ func (updateResponse *UpdateResponse) MarshalJSON() ([]byte, error) {
8383

8484
if pInfoFound {
8585
app.UpdateCheck.URLs.URLs = append(app.UpdateCheck.URLs.URLs, URL{
86-
CodebaseDiff: diffUrl,
86+
CodebaseDiff: diffURL,
8787
})
8888
pkg.NameDiff = patchInfo.Namediff
8989
pkg.DiffSHA256 = patchInfo.Hashdiff

extension/xml.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
)
88

99
// MarshalXML encodes the extension list into response XML
10-
func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
10+
func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error {
1111
type URL struct {
1212
XMLName xml.Name `xml:"url"`
1313
Codebase string `xml:"codebase,attr"`
@@ -83,7 +83,7 @@ func (updateResponse *UpdateResponse) MarshalXML(e *xml.Encoder, start xml.Start
8383
}
8484

8585
// MarshalXML encodes the extension list into response XML
86-
func (updateResponse *WebStoreUpdateResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
86+
func (updateResponse *WebStoreUpdateResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error {
8787
type UpdateCheck struct {
8888
XMLName xml.Name `xml:"updatecheck"`
8989
Status string `xml:"status,attr"`

server/server_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func testCall(t *testing.T, server *httptest.Server, method string, contentType
9393
req.Header.Add("Content-Type", contentType)
9494

9595
client := &http.Client{
96-
CheckRedirect: func(req *http.Request, via []*http.Request) error {
96+
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
9797
return http.ErrUseLastResponse
9898
},
9999
}
@@ -563,7 +563,7 @@ func TestPrintExtensions(t *testing.T) {
563563
req, err := http.NewRequest(http.MethodGet, testURL, bytes.NewBuffer([]byte("")))
564564
assert.Nil(t, err)
565565
client := &http.Client{
566-
CheckRedirect: func(req *http.Request, via []*http.Request) error {
566+
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
567567
return http.ErrUseLastResponse
568568
},
569569
}

0 commit comments

Comments
 (0)