// New provides a mock function with given fields:
517082
func (_m *PluginFactory) New() endorsement.Plugin {
	ret := _m.Called()

	var r0 endorsement.Plugin
	if rf, ok := ret.Get(0).(func() endorsement.Plugin); ok {
		r0 = rf()
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(endorsement.Plugin)
		}
	}

	return r0
}
493321
func New(e error, fields ...map[string]interface{}) *snapError {
	// Catch someone trying to wrap a serror around a serror.
	// We throw a panic to make them fix this.
	if _, ok := e.(SnapError); ok {
		panic("You are trying to wrap a snapError around a snapError. Don't do this.")
	}

	p := &snapError{
		err:    e,
		fields: make(map[string]interface{}),
	}

	// insert fields into new snapError
	for _, f := range fields {
		for k, v := range f {
			p.fields[k] = v
		}
	}

	return p
}
1175191
func New() (*Conn, error) {
	c := new(Conn)

	if err := c.initConnection(); err != nil {
		return nil, err
	}

	return c, nil
}
1160238
func New(hashsize int, conf *skein.Config) hash.Hash {
	s := new(hashFunc)
	s.initialize(hashsize, conf)
	return s
}
762332
func New(jsonReferenceString string) (Ref, error) {

	var r Ref
	err := r.parse(jsonReferenceString)
	return r, err

}
444918
func New(name string, funcs ...map[string]interface{}) *Tree {
	return &Tree{
		Name:  name,
		funcs: funcs,
	}
}
711989
func (g *Generator) New(varName string, varType interface{}) (string, error) {
	switch t := varType.(type) {
	case *Param:
		return g.New(varName, t.OriginalType)
	case types.Type:
		return g.varInitString(varName, t)
	}

	return "", fmt.Errorf("New: unsupported argument type: %T", varType)
}
6369
func (e *ErrorClass) New(format string, args ...interface{}) error {
	return e.wrap(fmt.Errorf(format, args...), nil, nil)
}
24095
func New(s interface{}) *Struct {
	return &Struct{
		raw:     s,
		value:   strctVal(s),
		TagName: DefaultTagName,
	}
}
1349873
func newFields() *fields {
	f := new(fields)
	f.fields = make(map[string]*fieldInfo)
	f.fieldsLow = make(map[string]*fieldInfo)
	f.columns = make(map[string]*fieldInfo)
	f.fieldsByType = make(map[int][]*fieldInfo)
	return f
}
894674
func (c Client) New(params *stripe.FileParams) (*stripe.File, error) {
	if params == nil {
		return nil, fmt.Errorf("params cannot be nil, and params.Purpose and params.File must be set")
	}

	bodyBuffer, boundary, err := params.GetBody()
	if err != nil {
		return nil, err
	}

	file := &stripe.File{}
	err = c.B.CallMultipart(http.MethodPost, "/v1/files", c.Key, boundary, bodyBuffer, &params.Params, file)

	return file, err
}
992016
func New(src, packageName string) (*Mocker, error) {
	srcPkg, err := pkgInfoFromPath(src, packages.LoadSyntax)
	if err != nil {
		return nil, fmt.Errorf("Couldn't load source package: %s", err)
	}
	pkgPath := srcPkg.PkgPath

	if len(packageName) == 0 {
		packageName = srcPkg.Name
	} else {
		mockPkgPath := filepath.Join(src, packageName)
		if _, err := os.Stat(mockPkgPath); os.IsNotExist(err) {
			os.Mkdir(mockPkgPath, os.ModePerm)
		}
		mockPkg, err := pkgInfoFromPath(mockPkgPath, packages.LoadFiles)
		if err != nil {
			return nil, fmt.Errorf("Couldn't load mock package: %s", err)
		}
		pkgPath = mockPkg.PkgPath
	}

	tmpl, err := template.New("moq").Funcs(templateFuncs).Parse(moqTemplate)
	if err != nil {
		return nil, err
	}
	return &Mocker{
		tmpl:    tmpl,
		srcPkg:  srcPkg,
		pkgName: packageName,
		pkgPath: pkgPath,
		imports: make(map[string]bool),
	}, nil
}
528535
func New(msg string, a ...interface{}) Error {
	msg = fmt.Sprintf(msg, a...)
	return Error{
		error: errors.New(msg),
	}
}
478592
func New(m string, a ...interface{}) error {
	return errors.Wrap(fmt.Errorf(m, a...), 1)
}
611016
func (g *Generator) New() (string, error) {
	if err := g.check(); err != nil {
		return "", err
	}
	f := strconv.Itoa(int(g.timestampGet()))
	s := g.macAddrFormat(g.macAddrGet())
	t := g.rHexString()
	s = s[len(s)-4:]
	id := fmt.Sprintf("%s%s%s", f, s, t)

	return id, nil
}
225011
func New(db *gorm.DB, keyPairs ...[]byte) *Store {
	return NewOptions(db, Options{}, keyPairs...)
}
609726
func New(config Config) gin.HandlerFunc {
	cors := newCors(config)
	return func(c *gin.Context) {
		cors.applyCors(c)
	}
}