good morning!!!!

Skip to content
Snippets Groups Projects
Commit 95eb09aa authored by Peter Kieltyka's avatar Peter Kieltyka
Browse files

Merge pull request #116 from c2h5oh/empty_int64array

Empty int64array should not result in scan error
parents ff1ff9d1 73332df7
Branches
Tags
No related merge requests found
......@@ -150,8 +150,9 @@ func (a *Int64Array) Scan(src interface{}) error {
}
s := string(b)[1 : len(b)-1]
parts := strings.Split(s, ",")
results := make([]int64, 0)
if s != "" {
parts := strings.Split(s, ",")
for _, n := range parts {
i, err := strconv.ParseInt(n, 10, 64)
if err != nil {
......@@ -159,6 +160,7 @@ func (a *Int64Array) Scan(src interface{}) error {
}
results = append(results, i)
}
}
*a = Int64Array(results)
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment