Reorganize code for more granular imports

This commit is contained in:
2025-02-26 10:34:25 +02:00
parent a9983f3531
commit 4bceb75695
23 changed files with 1549 additions and 1232 deletions

View File

@@ -0,0 +1,27 @@
package linkList
import (
"database/sql/driver"
"encoding/json"
"fmt"
"gemini-grc/common/url"
)
type LinkList []url.URL
func (l *LinkList) Value() (driver.Value, error) {
return json.Marshal(l)
}
func (l *LinkList) Scan(value interface{}) error {
if value == nil {
*l = nil
return nil
}
b, ok := value.([]byte) // Type assertion! Converts to []byte
if !ok {
return fmt.Errorf("failed to scan LinkList: expected []byte, got %T", value)
}
return json.Unmarshal(b, l)
}