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

@@ -9,18 +9,18 @@ import (
type ippResponseHeader struct {
versionNumber versionNumber
statusCode statusCode
requestId uint32
requestID uint32
}
func (h ippResponseHeader) String() string {
return fmt.Sprintf("Version number: %v Status code: %v Request Id: %v", h.versionNumber, h.statusCode, h.requestId)
return fmt.Sprintf("Version number: %v Status code: %v Request Id: %v", h.versionNumber, h.statusCode, h.requestID)
}
func (h *ippResponseHeader) marshal() []byte {
a := make([]byte, 8, 8)
a := make([]byte, 8)
binary.BigEndian.PutUint16(a[0:2], uint16(h.versionNumber))
binary.BigEndian.PutUint16(a[2:4], uint16(h.statusCode))
binary.BigEndian.PutUint32(a[4:8], h.requestId)
binary.BigEndian.PutUint32(a[4:8], h.requestID)
return a
}
@@ -28,7 +28,7 @@ func (h *ippResponseHeader) marshal() []byte {
func (h *ippResponseHeader) unmarshal(byteStream io.Reader) {
binary.Read(byteStream, binary.BigEndian, &h.versionNumber)
binary.Read(byteStream, binary.BigEndian, &h.statusCode)
binary.Read(byteStream, binary.BigEndian, &h.requestId)
binary.Read(byteStream, binary.BigEndian, &h.requestID)
}
type Response struct {
@@ -36,11 +36,11 @@ type Response struct {
header ippResponseHeader
}
func NewResponse(code statusCode, requestId uint32) *Response {
func NewResponse(code statusCode, requestID uint32) *Response {
r := new(Response)
r.a = new(attributes)
r.header.versionNumber = 0x0101
r.header.requestId = requestId
r.header.requestID = requestID
r.header.statusCode = code
return r
}