You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there!
I have a model in golang: type Transaction struct { ID string db:"id", Status int db:"status", Users []string db:"users",
and this is the sql for insert: sqlStr :=
INSERT INTO transactions (data, users)
VALUES (:data, :users)
RETURNING id tx := st.DB.MustBegin() defer tx.Commit() _, err := tx.NamedQuery(sqlStr, txs) return err
But I got an err: sql: converting argument $17 type: unsupported type []string, a slice of string
Can someone help to fix that, thank you very much!
The text was updated successfully, but these errors were encountered:
Hi there!
I have a model in golang:
type Transaction struct { ID string
db:"id", Status int
db:"status", Users []string
db:"users",
and this is the sql for insert:
sqlStr :=
INSERT INTO transactions (data, users)
VALUES (:data, :users)
RETURNING id
tx := st.DB.MustBegin() defer tx.Commit() _, err := tx.NamedQuery(sqlStr, txs) return err
But I got an err:
sql: converting argument $17 type: unsupported type []string, a slice of string
Can someone help to fix that, thank you very much!
The text was updated successfully, but these errors were encountered: