package repos type DefaultsRepo interface { DBGetDefaultsMap() (map[string]string, error) } func (p *Provider) DBGetDefaultsMap() (map[string]string, error) { rows, err := p.db.Queryx(`SELECT key, value FROM defaults; `) if err != nil { return nil, err } res := make(map[string]string) for rows.Next() { keyval, err := rows.SliceScan() if err != nil { return nil, err } key := keyval[0].(string) value := keyval[1].(string) res[key] = value } return res, nil }