Reputation: 31
Here is my code:
package main
import (
"database/sql"
)
func main() {
table := "some table"
args := []interface{}{"string1", "string2", "string3", "string4"}
_, err := db.Exec( "INSERT INTO" + table + "VALUES('', ?, ?, ?, ?)", args)
if err != nil {
return err
}
}
I want to pass in the args but cannot format them as "args ...interface{}"
Current output is:
sql: converting Exec argument #0's type: unsupported type []interface {}, a slice
Thanks in advance!
Upvotes: 2
Views: 6243