linting the code

This commit is contained in:
9seconds
2019-10-11 09:41:18 +03:00
parent 432e2970a0
commit 5009859a1e
50 changed files with 172 additions and 55 deletions
@@ -20,6 +20,7 @@ func (w *wrapperClientIntermediateSecure) Read(acks *conntypes.ConnectionAcks) (
if err != nil {
return nil, err
}
length := len(data) - (len(data) % 4)
return data[:length], nil
@@ -30,6 +31,7 @@ func (w *wrapperClientIntermediateSecure) Write(packet conntypes.Packet, acks *c
if _, err := w.parent.Write(packet); err != nil {
return fmt.Errorf("cannot send simpleacked packet: %w", err)
}
return nil
}
@@ -37,13 +39,14 @@ func (w *wrapperClientIntermediateSecure) Write(packet conntypes.Packet, acks *c
paddingLength := rand.Intn(4)
buf.Grow(4 + len(packet) + paddingLength)
binary.Write(&buf, binary.LittleEndian, uint32(len(packet)+paddingLength))
binary.Write(&buf, binary.LittleEndian, uint32(len(packet)+paddingLength)) // nolint: errcheck
buf.Write(packet)
buf.Write(make([]byte, paddingLength))
if _, err := w.parent.Write(buf.Bytes()); err != nil {
return fmt.Errorf("cannot send packet: %w", err)
}
return nil
}