Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hedhyw committed Sep 22, 2024
1 parent 11e2351 commit 5c91c0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions internal/pkg/source/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math"
"os"
"strconv"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -513,7 +514,7 @@ func TestNumericKindTimeFormatting(t *testing.T) {
}, {
TestName: "max_int64",
JSON: fmt.Sprintf(`{"timestamp":"%d"}`, math.MaxInt64),
ExpectedOutput: fmt.Sprintf("%d", math.MaxInt64),
ExpectedOutput: strconv.Itoa(math.MaxInt64),
}, {
TestName: "negative",
JSON: `{"timestamp":"-1"}`,
Expand All @@ -531,7 +532,7 @@ func TestNumericKindTimeFormatting(t *testing.T) {
}

func TestLazyLogEntryLength(t *testing.T) {
t.Name()
t.Parallel()

entry := t.Name() + "\n"

Expand All @@ -540,7 +541,7 @@ func TestLazyLogEntryLength(t *testing.T) {
}

func TestLazyLogEntryLine(t *testing.T) {
t.Name()
t.Parallel()

entry := t.Name() + "\n"

Expand Down Expand Up @@ -578,7 +579,7 @@ func TestLazyLogEntryLine(t *testing.T) {
}

func TestLazyLogEntryLogEntry(t *testing.T) {
t.Name()
t.Parallel()

entry := t.Name() + "\n"
cfg := config.GetDefaultConfig()
Expand Down
6 changes: 3 additions & 3 deletions internal/pkg/source/streamer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestStartStreamingEndOfFile(t *testing.T) {
case msg := <-entries:
cancel()

require.Equal(t, msg.Len(), 1)
require.Equal(t, 1, msg.Len())
assert.Contains(t, msg.Row(cfg, 0), entry)
case <-ctx.Done():
t.Fatal(ctx.Err())
Expand Down Expand Up @@ -80,7 +80,7 @@ func TestStartStreamingUpdates(t *testing.T) {

entries := make(chan source.LazyLogEntries)

inputSource.StartStreaming(ctx, func(msg source.LazyLogEntries, err error) {
inputSource.StartStreaming(ctx, func(msg source.LazyLogEntries, _ error) {
if msg.Len() == 0 {
return
}
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestStartStreamingFromFile(t *testing.T) {

entries := make(chan source.LazyLogEntries)

inputSource.StartStreaming(ctx, func(msg source.LazyLogEntries, err error) {
inputSource.StartStreaming(ctx, func(msg source.LazyLogEntries, _ error) {
if msg.Len() == 0 {
return
}
Expand Down

0 comments on commit 5c91c0b

Please sign in to comment.