Skip to content
Advertisement

Scan row into slice

I want to Scan a sql.Row into a slice like so:

but I am getting this error:

2020/02/23 20:05:14 raw query: SELECT * FROM user_table LIMIT 500 2020/02/23 20:05:14 sql: expected 6 destination arguments in Scan, not 0

anyone know how to make this generic without using a slice?

Advertisement

Answer

You can do it this way:

on the internet they say you can use:

instead of

but I think (string) is fine, idk

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement