mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-22 11:01:56 -08:00
Fix all golint comment related problems in the pkg packages
This commit is contained in:
parent
65d43576a0
commit
e7589e706e
17 changed files with 47 additions and 18 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue