func (w *Writer) WriteAll(records interface{}) error {
	m, ok := records.([]map[string]string)
	if ok {
		return w.writeMapStringAll(m)
	}
	return w.writeAnyAll(reflect.ValueOf(records))
}
WriteAll writes multiple LTSV records to w using Write and then calls Flush.
package ltsv
import (
	"bufio"
	"errors"
	"io"
	"reflect"
	"strconv"
	"strings"
	"sync"
	"unicode"
)
type Writer struct {
	Delimiter rune  
	UseCRLF   bool  
	w         *bufio.Writer
}
type structIndexLabelMap map[int]string
type formatter func(reflect.Value) (string, error)
var (
	ErrUnsupportedType        = errors.New("unsupported type")
	ErrLabelInvalid           = errors.New("label is invalid")
	ErrFieldInvalid           = errors.New("field is invalid")
	structIndexLabelCache     = make(map[reflect.Type]structIndexLabelMap)
	structIndexLabelCacheLock sync.RWMutex
)
func NewWriter(w io.Writer) *Writer {
	return &Writer{
		Delimiter: '\t',
		UseCRLF:   false,
		w:         bufio.NewWriter(w),
	}
}
func (w *Writer) Write(record interface{}) error {
	m, ok := record.(map[string]string)
	if ok {
		return w.writeMapString(m)
	}
	return w.writeAny(reflect.ValueOf(record))
}
func (w *Writer) writeMapString(record map[string]string) error {
	var err error
	cnt := 0
	for label, field := range record {
		if cnt >= 1 {
			if _, err = w.w.WriteRune(w.Delimiter); err != nil {
				return err
			}
		}
		if err = w.writeLabelAndField(label, field); err != nil {
			return err
		}
		cnt++
	}
	return w.writeLineEnd()
}
func (w *Writer) writeAny(v reflect.Value) error {
	var err error
	switch v.Kind() {
	case reflect.Struct:
		err = w.writeStruct(v)
	case reflect.Map:
		err = w.writeMap(v)
	case reflect.Interface, reflect.Ptr:
		if !v.IsNil() {
			return w.writeAny(v.Elem())
		}
	default:
		return ErrUnsupportedType
	}
	if err != nil {
		return err
	}
	return w.writeLineEnd()
}
func (w *Writer) Flush() {
	w.w.Flush()
}