Fix all golint comment related problems in the pkg packages

This commit is contained in:
Ola Bini 2019-12-21 17:19:26 +00:00
parent 65d43576a0
commit e7589e706e
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F
17 changed files with 47 additions and 18 deletions

View file

@ -9,6 +9,7 @@ import (
"math"
)
// PacketData contains one packet of information
type PacketData struct {
Buf []byte
offset int
@ -17,6 +18,7 @@ type PacketData struct {
ok bool
}
// New creates a new packet data from the buffer
func New(buf []byte) (pds *PacketData) {
pds = new(PacketData)
pds.Buf = buf
@ -25,10 +27,12 @@ func New(buf []byte) (pds *PacketData) {
return
}
// IsValid checks whether the current packet data is valid
func (pds *PacketData) IsValid() bool {
return pds.ok
}
// Skip will skip some data
func (pds *PacketData) Skip(skip int) {
if pds.Left() >= skip {
pds.offset += skip
@ -299,7 +303,7 @@ func (pds *PacketData) PutFloat64(val float64) {
pds.append(bits & 0xff)
}
// Copy a buffer out of the PacketData into dst.
// CopyBytes will copy a buffer out of the PacketData into dst.
func (pds *PacketData) CopyBytes(dst []byte) {
if pds.Left() >= len(dst) {
if copy(dst, pds.Buf[pds.offset:pds.offset+len(dst)]) != len(dst) {
@ -310,7 +314,7 @@ func (pds *PacketData) CopyBytes(dst []byte) {
}
}
// Put a buffer src into the PacketData at the
// PutBytes will put a buffer src into the PacketData at the
// current offset.
func (pds *PacketData) PutBytes(src []byte) {
if pds.Left() >= len(src) {