From b8d0d0c3b6b2ffe40921aa4c247c101dd0ce958d Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 1 Jul 2023 22:10:22 +0800 Subject: Refactor: rename consts to follow Go idiom. Fix const comment style. --- danmaku/dmpkg/raw.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'danmaku/dmpkg/raw.go') diff --git a/danmaku/dmpkg/raw.go b/danmaku/dmpkg/raw.go index 17b538a..34cd2e6 100644 --- a/danmaku/dmpkg/raw.go +++ b/danmaku/dmpkg/raw.go @@ -6,7 +6,7 @@ import ( "math" ) -const kMaxBodyLength = math.MaxUint32 - uint64(kHeaderLength) +const MaxBodyLength = math.MaxUint32 - uint64(HeaderLength) // NewPlainExchange creates a new exchange with raw body specified. // body: a struct or a raw string @@ -28,18 +28,18 @@ func NewPlainExchange(operation Operation, body interface{}) (exc DanmakuExchang } } - length := uint64(kHeaderLength + len(bodyData)) - if length > kMaxBodyLength { - err = fmt.Errorf("body is too large (> %d)", kMaxBodyLength) + length := uint64(HeaderLength + len(bodyData)) + if length > MaxBodyLength { + err = fmt.Errorf("body is too large (> %d)", MaxBodyLength) return } exc = DanmakuExchange{ DanmakuExchangeHeader: DanmakuExchangeHeader{ Length: uint32(length), - HeaderLength: kHeaderLength, + HeaderLength: HeaderLength, ProtocolVer: ProtoPlainJson, Operation: operation, - SequenceId: kSequenceId, + SequenceId: SequenceId, }, Body: bodyData, } -- cgit v1.2.3