From 1234c6146ebde18ef36dffe356ebf584006cf648 Mon Sep 17 00:00:00 2001 From: ramdos0207 Date: Sun, 17 Nov 2024 12:53:34 +0900 Subject: [PATCH] =?UTF-8?q?=E5=A4=89=E6=95=B0/=E5=BC=95=E6=95=B0=E5=90=8D?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/bot/ws/handler.go | 4 ++-- service/channel/tree_impl.go | 8 ++++---- service/ws/handler.go | 4 ++-- utils/storage/s3_object_test.go | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/service/bot/ws/handler.go b/service/bot/ws/handler.go index 5ba50c49e..0fc376114 100644 --- a/service/bot/ws/handler.go +++ b/service/bot/ws/handler.go @@ -77,9 +77,9 @@ Command: } } -func (s *session) sendErrorMessage(error string) { +func (s *session) sendErrorMessage(messeage string) { _ = s.WriteMessage(&rawMessage{ t: websocket.TextMessage, - data: makeErrorMessage(error).toJSON(), + data: makeErrorMessage(messeage).toJSON(), }) } diff --git a/service/channel/tree_impl.go b/service/channel/tree_impl.go index 2859ff2fc..2bfacbbdf 100644 --- a/service/channel/tree_impl.go +++ b/service/channel/tree_impl.go @@ -65,14 +65,14 @@ func (n *channelNode) getChildrenIDs() []uuid.UUID { } func (n *channelNode) getChannelDepth() int { - max := 0 + maxDepth := 0 for _, c := range n.children { d := c.getChannelDepth() - if max < d { - max = d + if maxDepth < d { + maxDepth = d } } - return max + 1 + return maxDepth + 1 } func (n *channelNode) getDescendantIDs() []uuid.UUID { diff --git a/service/ws/handler.go b/service/ws/handler.go index 2a4b5e5ab..3daa6e753 100644 --- a/service/ws/handler.go +++ b/service/ws/handler.go @@ -132,9 +132,9 @@ Command: } } -func (s *session) sendErrorMessage(error string) { +func (s *session) sendErrorMessage(messeage string) { _ = s.WriteMessage(&rawMessage{ t: websocket.TextMessage, - data: makeMessage("ERROR", error).toJSON(), + data: makeMessage("ERROR", messeage).toJSON(), }) } diff --git a/utils/storage/s3_object_test.go b/utils/storage/s3_object_test.go index 35749fa62..1dece1350 100644 --- a/utils/storage/s3_object_test.go +++ b/utils/storage/s3_object_test.go @@ -113,7 +113,7 @@ func tests3ObjectSeek(t *testing.T) { name string setupFunc func(t *testing.T) *s3Object args args - wantNewPos func(len, pos, offset int64) int64 + wantNewPos func(length, pos, offset int64) int64 wantErr bool }{ { @@ -173,8 +173,8 @@ func tests3ObjectSeek(t *testing.T) { offset: -1024, whence: 2, }, - wantNewPos: func(len, _, offset int64) int64 { - return len + offset + wantNewPos: func(length, _, offset int64) int64 { + return length + offset }, }, }