This code:
func DoStuff(input []Resource) {
rowsToken := [][]interface{}{}
for _, data := range input {
rowsToken = append(rowsToken, []interface{}{data.TokenID, data.Class})
}
_, err := IDB.CopyFrom(ctx, pgx.Identifier{"someTable"},
[]string{"id", "localization_id"}, pgx.CopyFromRows(rowsToken))
tool.CheckError(err, "info")
}
Is giving me this error:
Cannot use (pgx.Identifier literal) (value of type pgx.Identifier) as pgx.Identifier value in argument to IDB.CopyFrom
I've been using this as is in several other functions, don't know what I am doing wrong.
Here is pgx's documentation: https://godoc.org/github.com/jackc/pgx