diff --git a/internal/pkg/service/common/errors/countlimit.go b/internal/pkg/service/common/errors/countlimit.go index 3757b3d722..abb68a4d70 100644 --- a/internal/pkg/service/common/errors/countlimit.go +++ b/internal/pkg/service/common/errors/countlimit.go @@ -13,8 +13,8 @@ type CountLimitReachedError struct { in string } -func NewCountLimitReachedError(what string, max int, in string) CountLimitReachedError { - return CountLimitReachedError{what: what, max: max, in: in} +func NewCountLimitReachedError(what string, maximum int, in string) CountLimitReachedError { + return CountLimitReachedError{what: what, max: maximum, in: in} } func (e CountLimitReachedError) ErrorName() string { diff --git a/internal/pkg/service/common/etcdop/op/atomic_test.go b/internal/pkg/service/common/etcdop/op/atomic_test.go index 92226cdc0e..69a61f2419 100644 --- a/internal/pkg/service/common/etcdop/op/atomic_test.go +++ b/internal/pkg/service/common/etcdop/op/atomic_test.go @@ -418,7 +418,7 @@ func TestAtomicUpdate(t *testing.T) { var logger strings.Builder // Create atomic update operation - var beforeUpdate func() (clear bool) + var beforeUpdate func() (clearCallback bool) var valueFromGetPhase string var result string atomicOp := op.Atomic(client, &result) @@ -496,7 +496,7 @@ func TestAtomicUpdate(t *testing.T) { assert.Equal(t, "<>", string(r.Value)) // 3. Modification during update, DoWithoutRetry, fail - beforeUpdate = func() (clear bool) { + beforeUpdate = func() (clearCallback bool) { require.NoError(t, key1.Put(client, "newValue1").Do(ctx).Err()) return true } @@ -508,7 +508,7 @@ func TestAtomicUpdate(t *testing.T) { assert.Equal(t, "newValue1", string(r.Value)) // 4. Modification during update, Do, fail - beforeUpdate = func() (clear bool) { + beforeUpdate = func() (clearCallback bool) { require.NoError(t, key1.Put(client, "newValue3").Do(ctx).Err()) return false } @@ -521,7 +521,7 @@ func TestAtomicUpdate(t *testing.T) { assert.Equal(t, "newValue3", string(r.Value)) // 5. Modification during update, Do, success - beforeUpdate = func() (clear bool) { + beforeUpdate = func() (clearCallback bool) { require.NoError(t, key1.Put(client, "newValue2").Do(ctx).Err()) return true } diff --git a/internal/pkg/service/stream/storage/level/local/diskwriter/network/router/closesync/coordinator.go b/internal/pkg/service/stream/storage/level/local/diskwriter/network/router/closesync/coordinator.go index 6e0c087f51..ed047388ae 100644 --- a/internal/pkg/service/stream/storage/level/local/diskwriter/network/router/closesync/coordinator.go +++ b/internal/pkg/service/stream/storage/level/local/diskwriter/network/router/closesync/coordinator.go @@ -134,6 +134,6 @@ func (n *CoordinatorNode) invokeListeners() { } } -func greaterOrEqual(actual, min int64) bool { - return actual == NoSourceNode || actual >= min +func greaterOrEqual(actual, minimum int64) bool { + return actual == NoSourceNode || actual >= minimum } diff --git a/internal/pkg/utils/strhelper/strhelper.go b/internal/pkg/utils/strhelper/strhelper.go index 3226da1180..c10218d98e 100644 --- a/internal/pkg/utils/strhelper/strhelper.go +++ b/internal/pkg/utils/strhelper/strhelper.go @@ -91,11 +91,11 @@ func StripHTMLComments(str string) string { }) } -func Truncate(str string, max int, suffix string) string { - if len(str) <= max { +func Truncate(str string, maximum int, suffix string) string { + if len(str) <= maximum { return str } - return str[0:max] + suffix + return str[0:maximum] + suffix } // NormalizeName converts any string into kebab-case. diff --git a/pkg/lib/operation/project/remote/table/preview/render.go b/pkg/lib/operation/project/remote/table/preview/render.go index 9a58515684..809d9e05df 100644 --- a/pkg/lib/operation/project/remote/table/preview/render.go +++ b/pkg/lib/operation/project/remote/table/preview/render.go @@ -82,11 +82,11 @@ func renderPretty(table *keboola.TablePreview, adaptWidth bool) string { var b strings.Builder - truncate := func(s string, max int) string { - if !adaptWidth || len(s) <= max { + truncate := func(s string, maximum int) string { + if !adaptWidth || len(s) <= maximum { return s } - return fmt.Sprintf("%s...", s[:max-3]) + return fmt.Sprintf("%s...", s[:maximum-3]) } // draws a "border" line, e.g. `┏━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓` border := func(left, middle, right string, lf bool) {