func New(options ...func(*Parser)) *Parser {
	parser := &Parser{
		swagger: &spec.Swagger{
			SwaggerProps: spec.SwaggerProps{
				Info: &spec.Info{
					InfoProps: spec.InfoProps{
						Contact: &spec.ContactInfo{},
						License: nil,
					},
					VendorExtensible: spec.VendorExtensible{
						Extensions: spec.Extensions{},
					},
				},
				Paths: &spec.Paths{
					Paths: make(map[string]spec.PathItem),
				},
				Definitions:         make(map[string]spec.Schema),
				SecurityDefinitions: make(map[string]*spec.SecurityScheme),
			},
		},
		packages:           NewPackagesDefinitions(),
		debug:              log.New(os.Stdout, "", log.LstdFlags),
		parsedSchemas:      make(map[*TypeSpecDef]*Schema),
		outputSchemas:      make(map[*TypeSpecDef]*Schema),
		existSchemaNames:   make(map[string]*Schema),
		toBeRenamedSchemas: make(map[string]string),
		excludes:           make(map[string]bool),
	}
	for _, option := range options {
		option(parser)
	}
	return parser
}
New creates a new Parser with default properties.
package swag
import (
	"encoding/json"
	"errors"
	"fmt"
	"go/ast"
	"go/build"
	goparser "go/parser"
	"go/token"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"path/filepath"
	"reflect"
	"sort"
	"strconv"
	"strings"
	"unicode"
	"github.com/KyleBanks/depth"
	"github.com/go-openapi/spec"
)
const (
	CamelCase = "camelcase"
	PascalCase = "pascalcase"
	SnakeCase = "snakecase"
	acceptAttr      = "@accept"
	produceAttr     = "@produce"
	scopeAttrPrefix = "@scope."
)
var (
	ErrRecursiveParseStruct = errors.New("recursively parsing struct")
	ErrFuncTypeField = errors.New("field type is func")
	ErrFailedConvertPrimitiveType = errors.New("swag property: failed convert primitive type")
)
type Parser struct {
	swagger *spec.Swagger
	packages *PackagesDefinitions
	parsedSchemas map[*TypeSpecDef]*Schema
	outputSchemas map[*TypeSpecDef]*Schema
	existSchemaNames map[string]*Schema
	toBeRenamedSchemas map[string]string
	toBeRenamedRefURLs []*url.URL
	PropNamingStrategy string
	ParseVendor bool
	ParseDependency bool
	ParseInternal bool
	Strict bool
	structStack []*TypeSpecDef
	markdownFileDir string
	codeExampleFilesDir string
	collectionFormatInQuery string
	excludes map[string]bool
	debug Debugger
}
type Debugger interface {
	Printf(format string, v ...interface{})
}