func GetColumnNames(rows *pgx.Rows) ([]string, error) {
	cols := make([]string, 0, len((*rows).FieldDescriptions()))
	notatePrefix := ""
	for _, field := range (*rows).FieldDescriptions() {
		colName := string(field.Name)
		if strings.HasPrefix(colName, QueryColumnNotatePrefix) {
			splitted := strings.Split(colName, QueryColumnNotatePrefix)
			if len(splitted) != 2 {
				return nil, ErrColumnNotateSyntax
			}
			trimmed := strings.TrimSpace(splitted[1])
			if len(trimmed) == 0 {
				notatePrefix = ""
			} else {
				notatePrefix = strings.TrimRight(trimmed, ".") + "."
			}
		} else {
			colName = notatePrefix + colName
		}
		cols = append(cols, colName)
	}
	return cols, nil
}
This function returns a list of column names from SQL columns.

It renames SQL notated columns, when needed, for column names who start
with 'notate:' prefix (you can override prefix with QueryColumnNotatePrefix
variable)

From columns:
["a", "b", "notate:whatever", "a", "b"]

Will return:
["a", "b", "notate:whatever", "whatever.a", "whatever.b"]

Background info:

In order to allow complex queries and prevent having to expand on all column
names for complex mappings, delimiter columns are used to notate results
from postgres.

Imagine we have `SELECT a.*, b.* FROM ...` if both _a_ and _b_ tables have
a field name _id_ there would be no way for us to map it to a struct with
a couple of nested structs, however, if  we use column notation we can
rewrite the query as:

SELECT 0 as "notate:a",
a.*,
0 as "notate:b",
b.*
FROM ...

This way, everything that comes after column "notate:a" will be treated as if
we would have defined an alias for each column named "a.<col>", and so on

These notations allow zero (using "notate:" with nothing after colon),
one level (like the example above) or many levels of notations (just do
"notate:a.sub1.sub2")

This helps map values to struct with simple queries without having to list
all columns in the SQL.
package pgxscan
import (
	"errors"
	"reflect"
	"strings"
	"github.com/jackc/pgx/v4"
	"github.com/randallmlough/sqlmaper"
)
type rows struct {
	rows    pgx.Rows
	columns []string
	cfg     *Config
}
func (r *rows) Next() bool {
	return r.rows.Next()
}
func (r *rows) Err() error {
	return r.rows.Err()
}
var ErrColumnNotateSyntax = errors.New("column notate syntax is invalid: expecting \"notate:name\"")
var QueryColumnNotatePrefix = "notate:"