From 0e55788fd169db68911e5d36660c46be13311942 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 22 Oct 2025 16:58:12 +0200 Subject: [PATCH] Allow string and byte for type dec Signed-off-by: Bryan Frimin --- pkg/coredata/document_classification.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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)