Fix golint errors
This commit is contained in:
parent
02e0818aef
commit
81923720d1
@ -170,8 +170,10 @@ type Proc struct {
|
||||
WriteStreamIdx int // The index of read stream in function argument list
|
||||
}
|
||||
|
||||
// ProcMetaGenerate is a type for flags from @generate annotation
|
||||
type ProcMetaGenerate int
|
||||
|
||||
// @generate annotation can be none, client, server or both
|
||||
const (
|
||||
ProcMetaGenerateNone ProcMetaGenerate = iota
|
||||
ProcMetaGenerateClient
|
||||
@ -179,8 +181,10 @@ const (
|
||||
ProcMetaGenerateBoth
|
||||
)
|
||||
|
||||
// ProcMetaPriority is a type for values from @priority annotation
|
||||
type ProcMetaPriority int
|
||||
|
||||
// @priority annotation can be low or high
|
||||
const (
|
||||
ProcMetaPriorityLow ProcMetaPriority = iota
|
||||
ProcMetaPriorityHigh
|
||||
|
10
rpc.go
10
rpc.go
@ -343,17 +343,15 @@ func (l *Libvirt) requestStream(proc uint32, program uint32, payload []byte, out
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
err = l.sendPacket(serial, proc, program, nil, Stream, StatusOK)
|
||||
break
|
||||
} else {
|
||||
// keep original error
|
||||
err := l.sendPacket(serial, proc, program, nil, Stream, StatusError)
|
||||
if err != nil {
|
||||
outStreamErr <- err
|
||||
return
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
if n > 0 {
|
||||
err = l.sendPacket(serial, proc, program, buf[:n], Stream, StatusContinue)
|
||||
@ -438,11 +436,7 @@ func (l *Libvirt) sendPacket(serial uint32, proc uint32, program uint32, payload
|
||||
}
|
||||
}
|
||||
|
||||
if err := l.w.Flush(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return l.w.Flush()
|
||||
}
|
||||
|
||||
func (l *Libvirt) getResponse(c chan response) (response, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user