Fix lint warnings.
This commit was merged in pull request #11.
This commit is contained in:
@@ -9,27 +9,27 @@ import (
|
||||
|
||||
type ippMessageHeader struct {
|
||||
versionNumber versionNumber
|
||||
operationId OperationId
|
||||
requestId uint32
|
||||
operationID OperationID
|
||||
requestID uint32
|
||||
}
|
||||
|
||||
func (h *ippMessageHeader) unmarshal(byteStream io.Reader) {
|
||||
binary.Read(byteStream, binary.BigEndian, &h.versionNumber)
|
||||
binary.Read(byteStream, binary.BigEndian, &h.operationId)
|
||||
binary.Read(byteStream, binary.BigEndian, &h.requestId)
|
||||
binary.Read(byteStream, binary.BigEndian, &h.operationID)
|
||||
binary.Read(byteStream, binary.BigEndian, &h.requestID)
|
||||
}
|
||||
|
||||
func (h *ippMessageHeader) marshal() []byte {
|
||||
b := make([]byte, 0, 8)
|
||||
buf := bytes.NewBuffer(b)
|
||||
binary.Write(buf, binary.BigEndian, h.versionNumber)
|
||||
binary.Write(buf, binary.BigEndian, h.operationId)
|
||||
binary.Write(buf, binary.BigEndian, h.requestId)
|
||||
binary.Write(buf, binary.BigEndian, h.operationID)
|
||||
binary.Write(buf, binary.BigEndian, h.requestID)
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func (h ippMessageHeader) String() string {
|
||||
return fmt.Sprintf("Version number: %v Operation Id: %v Request Id: %v", h.versionNumber, h.operationId, h.requestId)
|
||||
return fmt.Sprintf("Version number: %v Operation Id: %v Request Id: %v", h.versionNumber, h.operationID, h.requestID)
|
||||
}
|
||||
|
||||
type AddValuer interface {
|
||||
@@ -41,10 +41,10 @@ type Request struct {
|
||||
header ippMessageHeader
|
||||
}
|
||||
|
||||
func NewRequest(op OperationId, requestId uint32) *Request {
|
||||
func NewRequest(op OperationID, requestID uint32) *Request {
|
||||
r := new(Request)
|
||||
r.header.operationId = op
|
||||
r.header.requestId = requestId
|
||||
r.header.operationID = op
|
||||
r.header.requestID = requestID
|
||||
r.header.versionNumber = 0x0200
|
||||
r.a = new(attributes)
|
||||
return r
|
||||
@@ -60,12 +60,12 @@ func (r *Request) UnMarshal(body io.Reader) {
|
||||
r.a = UnMarshalAttributues(body)
|
||||
}
|
||||
|
||||
func (r *Request) RequestId() uint32 {
|
||||
return r.header.requestId
|
||||
func (r *Request) RequestID() uint32 {
|
||||
return r.header.requestID
|
||||
}
|
||||
|
||||
func (r *Request) Operation() OperationId {
|
||||
return r.header.operationId
|
||||
func (r *Request) Operation() OperationID {
|
||||
return r.header.operationID
|
||||
}
|
||||
|
||||
func (r *Request) GetAttribute(name string) Attribute {
|
||||
|
||||
Reference in New Issue
Block a user