From edb1783894ceb70dfc408c244f1b79cc86fdbb72 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 12 May 2022 21:49:17 +0800 Subject: [PATCH] Fix lints. --- actor_test.go | 4 ---- cor_test.go | 3 +-- fp.go | 2 +- publisher_test.go | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/actor_test.go b/actor_test.go index 5ba3a5b..4938f4a 100644 --- a/actor_test.go +++ b/actor_test.go @@ -111,17 +111,14 @@ func TestActorAsk(t *testing.T) { timeout = 10 * time.Millisecond // Normal cases - actual = 0 expectedInt = 10 actual, _ = AskNewGenerics[interface{}, int](1).AskOnce(actorRoot, nil) assert.Equal(t, expectedInt, actual) // Ask with Timeout - actual = 0 expectedInt = 20 actual, _ = AskNewGenerics[interface{}, int](2).AskOnce(actorRoot, &timeout) assert.Equal(t, expectedInt, actual) // Ask channel - actual = 0 expectedInt = 30 ch := AskNewGenerics[interface{}, int](3).AskChannel(actorRoot) actual = <-*ch @@ -129,7 +126,6 @@ func TestActorAsk(t *testing.T) { assert.Equal(t, expectedInt, actual) // Timeout cases - actual = 9999 expectedInt = 0 actual, err = AskNewGenerics[interface{}, int](-1).AskOnce(actorRoot, &timeout) assert.Equal(t, expectedInt, actual) diff --git a/cor_test.go b/cor_test.go index d094fa4..d09e0f0 100644 --- a/cor_test.go +++ b/cor_test.go @@ -16,8 +16,7 @@ func logMessage(args ...interface{}) { } func TestCorYield(t *testing.T) { - var expectedInt int - actualInt := 0 + var expectedInt, actualInt int var testee *CorDef[interface{}] var wg sync.WaitGroup diff --git a/fp.go b/fp.go index 76cff95..eb24c94 100644 --- a/fp.go +++ b/fp.go @@ -1360,7 +1360,7 @@ func Flatten[T any](list ...[]T) []T { return Concat(result, list...) } -// Prepend returns the slice with the additional element added to the beggining +// Prepend returns the slice with the additional element added to the beginning func Prepend[T any](element T, list []T) []T { return append([]T{element}, list...) } diff --git a/publisher_test.go b/publisher_test.go index 001ad0c..7a5353a 100644 --- a/publisher_test.go +++ b/publisher_test.go @@ -8,8 +8,8 @@ import ( func TestPublisher(t *testing.T) { var s *Subscription[interface{}] + var p2 *PublisherDef[interface{}] p := Publisher.New() - p2 := p actual := 0 expected := 0