Tiny adjustment

pull/2744/head
RPRX 2020-09-24 11:09:14 +00:00 committed by GitHub
parent 3072cdccf4
commit 0e8e23897c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -19,13 +19,12 @@ func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error {
if bytes, err := proto.Marshal(addons); err != nil {
return newError("failed to marshal addons protobuf value").Base(err)
} else {
if err := buffer.WriteByte(byte(len(bytes))); err != nil {
return newError("failed to write addons protobuf length").Base(err)
}
if _, err := buffer.Write(bytes); err != nil {
return newError("failed to write addons protobuf value").Base(err)
}
}
if err := buffer.WriteByte(byte(len(bytes))); err != nil {
return newError("failed to write addons protobuf length").Base(err)
}
if _, err := buffer.Write(bytes); err != nil {
return newError("failed to write addons protobuf value").Base(err)
}
default: