Changed the contract.
parent
2a6cbb7bd3
commit
2dfd8be146
|
@ -22,7 +22,8 @@ import (
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Convert the supplied bazilfuse request struct to an Op.
|
// Convert the supplied bazilfuse request struct to an Op, returning nil if it
|
||||||
|
// is unknown.
|
||||||
//
|
//
|
||||||
// This function is an implementation detail of the fuse package, and must not
|
// This function is an implementation detail of the fuse package, and must not
|
||||||
// be called by anyone else.
|
// be called by anyone else.
|
||||||
|
@ -121,8 +122,7 @@ func Convert(r bazilfuse.Request) (o Op) {
|
||||||
co = &to.commonOp
|
co = &to.commonOp
|
||||||
|
|
||||||
default:
|
default:
|
||||||
co = &commonOp{}
|
return
|
||||||
o = co
|
|
||||||
}
|
}
|
||||||
|
|
||||||
co.init(r)
|
co.init(r)
|
||||||
|
@ -152,7 +152,7 @@ func (o *commonOp) Context() context.Context {
|
||||||
return o.ctx
|
return o.ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *commonOp) Respond(err error) {
|
func (o *commonOp) respondErr(err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Expect non-nil here.")
|
panic("Expect non-nil here.")
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ type InitOp struct {
|
||||||
|
|
||||||
func (o *InitOp) Respond(err error) {
|
func (o *InitOp) Respond(err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
o.commonOp.Respond(err)
|
o.commonOp.respondErr(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue