summaryrefslogtreecommitdiff
path: root/danmaku/dmpkg/raw.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-01 22:10:22 +0800
committerKeuin <[email protected]>2023-07-01 22:10:44 +0800
commitb8d0d0c3b6b2ffe40921aa4c247c101dd0ce958d (patch)
treec14f512312a6ee2fab6bdaef7cb55dfedbf19262 /danmaku/dmpkg/raw.go
parent8f07f6f4d7e91a9e4b7164a39759907fac5fb8a1 (diff)
Refactor: rename consts to follow Go idiom. Fix const comment style.
Diffstat (limited to 'danmaku/dmpkg/raw.go')
-rw-r--r--danmaku/dmpkg/raw.go12
1 files changed, 6 insertions, 6 deletions
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,
}