Allow string and byte for type dec
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -34,9 +34,14 @@ func (dc *DocumentClassification) Scan(value interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
sv, ok := value.(string)
|
var sv string
|
||||||
if !ok {
|
switch v := value.(type) {
|
||||||
return fmt.Errorf("failed to scan DocumentClassification: %v", value)
|
case string:
|
||||||
|
sv = v
|
||||||
|
case []byte:
|
||||||
|
sv = string(v)
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("failed to scan DocumentClassification: expected string or []byte, got %T", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
*dc = DocumentClassification(sv)
|
*dc = DocumentClassification(sv)
|
||||||
|
|||||||
Reference in New Issue
Block a user