func (g *Generator) OmitEmpty() {
	g.omitEmpty = true
}
OmitEmpty triggers `json=",omitempty"` behaviour by default.
package gen
import (
	"bytes"
	"fmt"
	"hash/fnv"
	"io"
	"path"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"unicode"
)
const pkgWriter = "github.com/mailru/easyjson/jwriter"
const pkgLexer = "github.com/mailru/easyjson/jlexer"
const pkgEasyJSON = "github.com/mailru/easyjson"
type FieldNamer interface {
	GetJSONFieldName(t reflect.Type, f reflect.StructField) string
}
type Generator struct {
	out *bytes.Buffer
	pkgName    string
	pkgPath    string
	buildTags  string
	hashString string
	varCounter int
	noStdMarshalers bool
	omitEmpty       bool
	fieldNamer      FieldNamer
	imports map[string]string
	marshalers map[reflect.Type]bool
	typesSeen map[reflect.Type]bool
	typesUnseen []reflect.Type
	functionNames map[string]reflect.Type
}
func NewGenerator(filename string) *Generator {
	ret := &Generator{
		imports: map[string]string{
			pkgWriter:       "jwriter",
			pkgLexer:        "jlexer",
			pkgEasyJSON:     "easyjson",
			"encoding/json": "json",
		},
		fieldNamer:    DefaultFieldNamer{},
		marshalers:    make(map[reflect.Type]bool),
		typesSeen:     make(map[reflect.Type]bool),
		functionNames: make(map[string]reflect.Type),
	}
	hash := fnv.New32()
	hash.Write([]byte(filename))
	ret.hashString = fmt.Sprintf("%x", hash.Sum32())
	return ret
}
func (g *Generator) SetPkg(name, path string) {
	g.pkgName = name
	g.pkgPath = path
}
func (g *Generator) SetBuildTags(tags string) {
	g.buildTags = tags
}
func (g *Generator) SetFieldNamer(n FieldNamer) {
	g.fieldNamer = n
}
func (g *Generator) UseSnakeCase() {
	g.fieldNamer = SnakeCaseFieldNamer{}
}
func (g *Generator) NoStdMarshalers() {
	g.noStdMarshalers = true
}