func (e *Encoder) ColNames() []string {
	ret := make([]string, len(e.colNames))
	_ = copy(ret, e.colNames)
	return ret
}
ColNames returns the encoder's saved column names as a copy.  The
colNames field must be populated before using this.
package struct2csv
import (
	"errors"
	"fmt"
	"reflect"
	"sort"
	"strconv"
	"strings"
)
type StructRequiredError struct {
	kind reflect.Kind
}
func (e StructRequiredError) Error() string {
	return fmt.Sprintf("struct2csv: a value of type struct is required: type was %s", e.kind)
}
type StructSliceError struct {
	kind      reflect.Kind
	sliceKind reflect.Kind
}
func (e StructSliceError) Error() string {
	if e.kind != reflect.Slice {
		return fmt.Sprintf("struct2csv: a type of slice is required: type was %s", e.kind)
	}
	return fmt.Sprintf("struct2csv: a slice of type struct is required: slice type was %s", e.sliceKind)
}
var (
	ErrNilSlice = errors.New("struct2csv: the slice of structs was nil")
	ErrEmptySlice = errors.New("struct2csv: the slice of structs was empty")
)
type stringValues []reflect.Value
func (sv stringValues) Len() int           { return len(sv) }
func (sv stringValues) Swap(i, j int)      { sv[i], sv[j] = sv[j], sv[i] }
func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) }
func (sv stringValues) get(i int) string   { return sv[i].String() }
type Encoder struct {
	useTags  bool
	base     int
	tag      string  
	sepBeg   string
	sepEnd   string
	colNames []string
}
func New() *Encoder {
	return &Encoder{
		useTags: true, base: 10, tag: "csv",
		sepBeg: "(", sepEnd: ")",
	}
}
func (e *Encoder) SetTag(s string) {
	if s == "" {
		return
	}
	e.tag = s
}
func (e *Encoder) SetUseTags(b bool) {
	e.useTags = b
}
func (e *Encoder) SetSeparators(beg, end string) {
	e.sepBeg = beg
	e.sepEnd = end
}
func (e *Encoder) SetBase(i int) {
	if i < 2 {
		i = 2
	}
	e.base = i
}