Added a hook for fixing op type descriptions.

geesefs-0-30-9
Aaron Jacobs 2015-05-01 11:02:39 +10:00
parent 966bfc881c
commit cf9ed934d5
2 changed files with 9 additions and 3 deletions

View File

@ -31,12 +31,18 @@ type commonOp struct {
opsInFlight *sync.WaitGroup opsInFlight *sync.WaitGroup
} }
func describeOpType(t reflect.Type) (desc string) {
// TODO(jacobsa): Make this nicer.
desc = t.String()
return
}
func (o *commonOp) init( func (o *commonOp) init(
opType string, opType reflect.Type,
r bazilfuse.Request, r bazilfuse.Request,
log func(int, string, ...interface{}), log func(int, string, ...interface{}),
opsInFlight *sync.WaitGroup) { opsInFlight *sync.WaitGroup) {
o.opType = opType o.opType = describeOpType(opType)
o.ctx = context.Background() o.ctx = context.Background()
o.r = r o.r = r
o.log = log o.log = log

View File

@ -213,7 +213,7 @@ func Convert(
return return
} }
co.init(reflect.TypeOf(o).String(), r, logForOp, opsInFlight) co.init(reflect.TypeOf(o), r, logForOp, opsInFlight)
return return
} }