2
0

Generate UUIDArray from template

- Fix error in Set
- Specifically handle untyped nil
This commit is contained in:
Jack Christensen
2017-08-29 14:33:25 -05:00
parent 2dfcf74f62
commit 703ce85513
20 changed files with 129 additions and 19 deletions
+7 -1
View File
@@ -15,6 +15,12 @@ type Float8Array struct {
}
func (dst *Float8Array) Set(src interface{}) error {
// untyped nil and typed nil interfaces are different
if src == nil {
*dst = Float8Array{Status: Null}
return nil
}
switch value := src.(type) {
case []float64:
@@ -40,7 +46,7 @@ func (dst *Float8Array) Set(src interface{}) error {
if originalSrc, ok := underlyingSliceType(src); ok {
return dst.Set(originalSrc)
}
return errors.Errorf("cannot convert %v to Float8", value)
return errors.Errorf("cannot convert %v to Float8Array", value)
}
return nil