Implement fmt.Stringer for db.StringSlice
This commit is contained in:
parent
0a98a24833
commit
2aa95df91b
|
@ -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")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue