diff --git a/pkg/coredata/document_classification.go b/pkg/coredata/document_classification.go index 027c3a1db..c85ec3d8e 100644 --- a/pkg/coredata/document_classification.go +++ b/pkg/coredata/document_classification.go @@ -34,9 +34,14 @@ func (dc *DocumentClassification) Scan(value interface{}) error { return nil } - sv, ok := value.(string) - if !ok { - return fmt.Errorf("failed to scan DocumentClassification: %v", value) + var sv string + switch v := value.(type) { + 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)