This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// to be used in association with the golang sql package, rows.Scan() | |
// pass in any struct object/object slice you like and get appropriate results using reflection | |
// restriction: the sql query result's columns length must match the struct object fields length (len(rows.Columns(), fix your query) |