clean up boulderTypeConverter
This commit is contained in:
parent
0a4affaeba
commit
421434f2cb
|
|
@ -116,29 +116,17 @@ func (tc boulderTypeConverter) FromDb(target interface{}) (gorp.CustomScanner, b
|
||||||
return gorp.CustomScanner{new(string), target, binder}, true
|
return gorp.CustomScanner{new(string), target, binder}, true
|
||||||
case *core.AcmeStatus:
|
case *core.AcmeStatus:
|
||||||
binder := func(holder, target interface{}) error {
|
binder := func(holder, target interface{}) error {
|
||||||
s, ok := holder.(*string)
|
s := holder.(*string)
|
||||||
if !ok {
|
st := target.(*core.AcmeStatus)
|
||||||
return errors.New("FromDb: Unable to convert core.OCSPStatus to string")
|
*st = core.AcmeStatus(*s)
|
||||||
}
|
|
||||||
st, ok := target.(*core.AcmeStatus)
|
|
||||||
if !ok {
|
|
||||||
return errors.New("FromDb: Unable to convert core.OCSPStatus to string")
|
|
||||||
}
|
|
||||||
*st = core.AcmeStatus(string(*s))
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return gorp.CustomScanner{new(string), target, binder}, true
|
return gorp.CustomScanner{new(string), target, binder}, true
|
||||||
case *core.OCSPStatus:
|
case *core.OCSPStatus:
|
||||||
binder := func(holder, target interface{}) error {
|
binder := func(holder, target interface{}) error {
|
||||||
s, ok := holder.(*string)
|
s := holder.(*string)
|
||||||
if !ok {
|
st := target.(*core.OCSPStatus)
|
||||||
return errors.New("FromDb: Unable to convert core.OCSPStatus to string")
|
*st = core.OCSPStatus(*s)
|
||||||
}
|
|
||||||
st, ok := target.(*core.OCSPStatus)
|
|
||||||
if !ok {
|
|
||||||
return errors.New("FromDb: Unable to convert core.OCSPStatus to string")
|
|
||||||
}
|
|
||||||
*st = core.OCSPStatus(string(*s))
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return gorp.CustomScanner{new(string), target, binder}, true
|
return gorp.CustomScanner{new(string), target, binder}, true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue