Skip to content

Commit 7e16677

Browse files
chore(lint): Fix linter
1 parent 1478756 commit 7e16677

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

yacache/memory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func TestMemory_FetchWorkflow_Works(t *testing.T) {
224224

225225
expected[yachildKey] = yavalue
226226

227-
var keys []string
227+
keys := make([]string, 0, 10)
228228

229229
for i := range 10 {
230230
keys = append(keys, fmt.Sprintf("%s:%d", yamainKey, i))

yacache/redis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestRedisCacheService(t *testing.T) {
5858

5959
expected[yachildKey2] = yavalue2
6060

61-
var keys []string
61+
keys := make([]string, 0, 10)
6262

6363
for i := range 10 {
6464
keys = append(keys, fmt.Sprintf("%s:%d", yamainKey2, i))

yaratelimit/yaratelimit.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ func (r *RateLimit[Cache]) Refresh(
218218
id uint64,
219219
group string,
220220
) yaerrors.Error {
221-
if err := r.Cache.Set(ctx, FormatKey(id, group), fmt.Sprintf("%d,%d", 1, time.Now().Unix()), 0); err != nil {
221+
if err := r.Cache.Set(
222+
ctx,
223+
FormatKey(id, group),
224+
fmt.Sprintf("%d,%d", 1, time.Now().Unix()),
225+
0,
226+
); err != nil {
222227
return err.Wrap("failed to set refreshed storage")
223228
}
224229

yatgmessageencoding/markdown.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,10 @@ func (m *markdownEncoding) Unparse(text string, entities []tg.MessageEntityClass
460460
URLLike.emoji.startPosition = index
461461
URLLike.emoji.middlePosition = multiSize{
462462
// This value is not used in this case, but filling it it would require extra calculations
463-
utf8: maxUint32,
464-
utf16LECU: index.utf16LECU - offset.utf16LECU + uint32(entity.GetLength()),
463+
utf8: maxUint32,
464+
utf16LECU: index.utf16LECU - offset.utf16LECU + uint32(
465+
entity.GetLength(),
466+
),
465467
}
466468
URLLike.emoji.URL = strconv.FormatInt(entity.DocumentID, 10)
467469
}

0 commit comments

Comments
 (0)