Skip to content

Commit 91d519b

Browse files
author
Francisco Souza
committed
Make the linter more sensitive
"sensitive" is a nice word for annoying.
1 parent bac5399 commit 91d519b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

api_status_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func TestAPIStatus(t *testing.T) {
11-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
11+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
1212
w.Write([]byte(`{"status":"Encoding Queue Processing Delays","status_code":"queue_slow","incident":"Our encoding queue is processing slower than normal. Check back for updates."}`))
1313
}))
1414
defer server.Close()
@@ -34,7 +34,7 @@ func TestAPIStatusFailToConnect(t *testing.T) {
3434
}
3535

3636
func TestAPIStatusInvalidResponse(t *testing.T) {
37-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
37+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
3838
w.Write([]byte(`{not a valid json}`))
3939
}))
4040
defer server.Close()
@@ -56,6 +56,7 @@ func TestAPIStatusOK(t *testing.T) {
5656
{"pc_queue_slow", false},
5757
}
5858
for _, test := range tests {
59+
test := test
5960
t.Run(test.input, func(t *testing.T) {
6061
status := APIStatusResponse{StatusCode: test.input}
6162
got := status.OK()

client_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func TestYesNoBooleanMarshal(t *testing.T) {
4141
},
4242
}
4343
for _, test := range tests {
44+
test := test
4445
t.Run(test.name, func(t *testing.T) {
4546
input := YesNoBoolean(test.input)
4647
data, err := json.Marshal(input)
@@ -100,6 +101,7 @@ func TestZeroOneBooleanMarshal(t *testing.T) {
100101
},
101102
}
102103
for _, test := range tests {
104+
test := test
103105
t.Run(test.name, func(t *testing.T) {
104106
input := ZeroOneBoolean(test.input)
105107
data, err := json.Marshal(input)
@@ -178,7 +180,7 @@ func TestDoMediaActionFailure(t *testing.T) {
178180
}
179181

180182
func TestDoMissingRequiredParameters(t *testing.T) {
181-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
183+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
182184
byteResponse, _ := json.Marshal(mockMediaResponseObject("", "Wrong user id or key!"))
183185
w.Write(byteResponse)
184186
}))
@@ -204,7 +206,7 @@ func TestDoMissingRequiredParameters(t *testing.T) {
204206

205207
func TestDoMediaResponse(t *testing.T) {
206208
const msg = "it worked!"
207-
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
209+
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
208210
byteResponse, _ := json.Marshal(mockMediaResponseObject(msg, ""))
209211
w.Write(byteResponse)
210212
}))

preset_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ func TestPresetFormatStream(t *testing.T) {
355355
},
356356
}
357357
for _, test := range tests {
358+
test := test
358359
t.Run(test.testCase, func(t *testing.T) {
359360
p := PresetFormat{StreamRawMap: test.streamRaw}
360361
streams := p.Stream()

0 commit comments

Comments
 (0)