Skip to content

Commit

Permalink
Fix linter errors #4
Browse files Browse the repository at this point in the history
  • Loading branch information
tdancheva committed May 29, 2023
1 parent 5906ba3 commit 087a8e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libbeat/reader/readfile/line.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (r *LineReader) decode(end int) (int, error) {
nDst, nSrc, err = r.decoder.Transform(r.tempBuffer, inBytes[start:end], false)
if err != nil {
// Check if error is different from destination buffer too short
if !(err == transform.ErrShortDst) {
if !(errors.Is(err, transform.ErrShortDst)) {
_, _ = r.outBuffer.Write(inBytes[0:end])
start = end
break
Expand Down
2 changes: 1 addition & 1 deletion libbeat/reader/readfile/line_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func TestBufferSize(t *testing.T) {
for i := 0; i < len(lines); i++ {
b, n, err := reader.Next()
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
} else {
t.Fatal("unexpected error:", err)
Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/input/awss3/s3_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
Expand Down
3 changes: 2 additions & 1 deletion x-pack/filebeat/input/awss3/s3_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func newS3GetObjectResponse(filename string, data []byte, contentType string) *s
}

func TestS3ObjectProcessor(t *testing.T) {
logp.TestingSetup()
errSetup := logp.TestingSetup()
if errSetup != nil

t.Run("download text/plain file", func(t *testing.T) {
testProcessS3Object(t, "testdata/log.txt", "text/plain", 2)
Expand Down

0 comments on commit 087a8e1

Please sign in to comment.