Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paupm committed Apr 3, 2024
1 parent ecc1e5d commit ea0f2a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/messages/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (m Message) Ack() (Ack, error) {
}, nil
}

func (m Message) setAsAcked() error {
func (m *Message) setAsAcked() error {
if m.acked {
return errors.New("Message already acked")
}
Expand Down
9 changes: 4 additions & 5 deletions pkg/writers/adapters/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"io"
"os"
"strings"
"testing"
)
Expand Down Expand Up @@ -98,7 +97,7 @@ func TestBulkActionWithSingleItemSucessful(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")),
Body: io.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"create\":{\"status\":200}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand All @@ -125,7 +124,7 @@ func TestBulkActionWithSingleItemUnsuccessful(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")),
Body: io.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand All @@ -152,7 +151,7 @@ func TestBulkActionWithMixedItemStatus(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: os.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")),
Body: io.NopCloser(strings.NewReader("{\"errors\":true,\"items\":[{\"create\":{\"status\":409}},{\"create\":{\"status\":200}},{\"create\":{\"status\":409}}]}")),
}
bulk.On("func1", mock.Anything).Once().Return(&response, nil)

Expand Down Expand Up @@ -189,7 +188,7 @@ func TestBulkActionWithOnlyMetadata(t *testing.T) {
response := esapi.Response{
StatusCode: 201,
Header: nil,
Body: os.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")),
Body: io.NopCloser(strings.NewReader("{\"errors\":false,\"items\":[{\"delete\":{\"status\":200}}]}")),
}
expectedBody := "{\"delete\":{\"_id\":\"123\"}}\n"
bulk.On("func1", expectedBody).Once().Return(&response, nil)
Expand Down

0 comments on commit ea0f2a1

Please sign in to comment.