Implement fmt.Stringer for db.StringSlice

This commit is contained in:
Elara 2023-12-27 13:02:56 -08:00
parent 0a98a24833
commit 2aa95df91b
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,10 @@ import (
type StringSlice []string
func (s StringSlice) String() string {
return strings.Join(s, ",")
}
func (s StringSlice) Value() (driver.Value, error) {
return strings.Join(s, "\x1F"), nil
}
@ -26,4 +30,4 @@ func splitOptions(s string) []string {
return nil
}
return strings.Split(s, "\x1F")
}
}