From 2dfd8be1460cf675901695422744c48e4ec82305 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 24 Mar 2015 14:41:51 +1100 Subject: [PATCH] Changed the contract. --- fuseops/convert.go | 8 ++++---- fuseops/ops.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fuseops/convert.go b/fuseops/convert.go index b2b6c4c..27b9e62 100644 --- a/fuseops/convert.go +++ b/fuseops/convert.go @@ -22,7 +22,8 @@ import ( "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 // be called by anyone else. @@ -121,8 +122,7 @@ func Convert(r bazilfuse.Request) (o Op) { co = &to.commonOp default: - co = &commonOp{} - o = co + return } co.init(r) @@ -152,7 +152,7 @@ func (o *commonOp) Context() context.Context { return o.ctx } -func (o *commonOp) Respond(err error) { +func (o *commonOp) respondErr(err error) { if err != nil { panic("Expect non-nil here.") } diff --git a/fuseops/ops.go b/fuseops/ops.go index bd8e7ea..6c628d9 100644 --- a/fuseops/ops.go +++ b/fuseops/ops.go @@ -49,7 +49,7 @@ type InitOp struct { func (o *InitOp) Respond(err error) { if err != nil { - o.commonOp.Respond(err) + o.commonOp.respondErr(err) return }