diff options
author | Keuin <[email protected]> | 2023-07-01 22:10:22 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-01 22:10:44 +0800 |
commit | b8d0d0c3b6b2ffe40921aa4c247c101dd0ce958d (patch) | |
tree | c14f512312a6ee2fab6bdaef7cb55dfedbf19262 /danmaku/dmpkg/package.go | |
parent | 8f07f6f4d7e91a9e4b7164a39759907fac5fb8a1 (diff) |
Refactor: rename consts to follow Go idiom. Fix const comment style.
Diffstat (limited to 'danmaku/dmpkg/package.go')
-rw-r--r-- | danmaku/dmpkg/package.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/danmaku/dmpkg/package.go b/danmaku/dmpkg/package.go index 3175a18..51c769a 100644 --- a/danmaku/dmpkg/package.go +++ b/danmaku/dmpkg/package.go @@ -31,8 +31,10 @@ func (e *DanmakuExchange) String() string { e.Length, e.ProtocolVer, e.Operation, e.Body) } -const kHeaderLength = 16 -const kSequenceId = 1 +const ( + HeaderLength = 16 + SequenceId = 1 +) type ProtocolVer uint16 @@ -47,9 +49,12 @@ const ( ProtoBrotli ProtocolVer = 3 ) -const kUidGuest = 0 -const kPlatformWeb = "web" -const kAuthTypeDefault = 2 // magic number, not sure what does it mean +const ( + UidGuest = 0 + PlatformWeb = "web" + // AuthTypeDefault magic number, not sure what does it mean + AuthTypeDefault = 2 +) func (e *DanmakuExchange) Marshal() (data []byte, err error) { var buffer bytes.Buffer |