Fix lint warnings.

This commit was merged in pull request #11.
This commit is contained in:
2021-01-09 12:10:43 +01:00
parent f449b535db
commit 0805cec129
19 changed files with 85 additions and 84 deletions

View File

@@ -37,15 +37,15 @@ func (b *boolean) unmarshal(byteStream io.Reader) {
log.Warn("Unmarshal of boolean is not implemented yet")
}
func (e *boolean) marshal() []byte {
l := 5 + len(e.name)
b := make([]byte, 0, l)
buf := bytes.NewBuffer(b)
func (b *boolean) marshal() []byte {
l := 5 + len(b.name)
ba := make([]byte, 0, l)
buf := bytes.NewBuffer(ba)
buf.WriteByte(byte(booleanValueTag))
binary.Write(buf, binary.BigEndian, uint16(len(e.name)))
buf.WriteString(e.name)
binary.Write(buf, binary.BigEndian, uint16(len(b.name)))
buf.WriteString(b.name)
binary.Write(buf, binary.BigEndian, uint16(1))
if e.value {
if b.value {
buf.WriteByte(byte(1))
} else {
buf.WriteByte(byte(0))
@@ -53,7 +53,7 @@ func (e *boolean) marshal() []byte {
return buf.Bytes()
}
func (e *boolean) size() int {
l := 5 + len(e.name)
func (b *boolean) size() int {
l := 5 + len(b.name)
return l
}