mikrotik-exporter/vendor/gopkg.in/routeros.v2/chan_reply.go
2017-08-27 23:27:11 -04:00

23 lines
408 B
Go

package routeros
import "gopkg.in/routeros.v2/proto"
// chanReply is shared between ListenReply and AsyncReply.
type chanReply struct {
tag string
err error
reC chan *proto.Sentence
}
// Err returns the first error that happened processing sentences with tag.
func (a *chanReply) Err() error {
return a.err
}
func (a *chanReply) close(err error) {
if a.err == nil {
a.err = err
}
close(a.reC)
}