lxd/db/query/objects.go
func SelectObjects(stmt *sql.Stmt, dest Dest, args ...interface{}) error {
	rows, err := stmt.Query(args...)
	if err != nil {
		return err
	}
	defer rows.Close()

	for i := 0; rows.Next(); i++ {
		err := rows.Scan(dest(i)...)
		if err != nil {
			return err
		}
	}

	err = rows.Err()
	if err != nil {
		return err
	}
	return nil
}
func SelectObjects(stmt *sql.Stmt, dest Dest, args ...interface{}) error {
	rows, err := stmt.Query(args...)
	if err != nil {
		return err
	}
	defer rows.Close()

	for i := 0; rows.Next(); i++ {
		err := rows.Scan(dest(i)...)
		if err != nil {
			return err
		}
	}

	err = rows.Err()
	if err != nil {
		return err
	}
	return nil
}
func SelectObjects ( stmt * sql . Stmt , dest Dest , args ... interface { } ) error { rows , err := stmt . Query ( args ... ) if err != nil { return err } defer rows . Close ( ) for i := 0 ; rows . Next ( ) ; i ++ { err := rows . Scan ( dest ( i ) ... ) if err != nil { return err } } err = rows . Err ( ) if err != nil { return err } return nil }
// SelectObjects executes a statement which must yield rows with a specific
// columns schema. It invokes the given Dest hook for each yielded row.
SelectObjects executes a statement which must yield rows with a specific columns schema . It invokes the given Dest hook for each yielded row .