Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
golangci-lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam committed Feb 9, 2024
1 parent 63f015e commit 4162ea5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pkg/http/fileserver/fileserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ func TestFileServer_ServeHTTP(t *testing.T) {
for name, content := range tt.giveFiles {
file, createErr := os.Create(filepath.Join(tmpDir, name))
assert.NoError(t, createErr)

_, fileWritingErr := file.Write(content)

assert.NoError(t, fileWritingErr)
assert.NoError(t, file.Close())
}
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/http/middlewares/logreq/logreq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func TestMiddleware(t *testing.T) {
})

var asJSON map[string]interface{}

assert.NoError(t, json.Unmarshal([]byte(output), &asJSON), "logger output must be valid JSON")

tt.checkOutputFields(t, asJSON)
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/http/middlewares/panic/panic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func TestMiddleware(t *testing.T) {
})

var asJSON map[string]interface{}

assert.NoError(t, json.Unmarshal([]byte(output), &asJSON), "logger output must be valid JSON")

tt.checkResult(t, asJSON, rr)
Expand Down
3 changes: 3 additions & 0 deletions pkg/hostsfile/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ func BenchmarkParse(b *testing.B) {

b.SetBytes(int64(len(raw)))
b.ResetTimer()

for n := 0; n < b.N; n++ {
b.StopTimer()

buf := bytes.NewBuffer(raw)

b.StartTimer()

_, e := Parse(buf)
Expand Down

0 comments on commit 4162ea5

Please sign in to comment.