// NewBuilder indicates an expected call of NewBuilder
510108
func (mr *MockBuilderFactoryMockRecorder) NewBuilder(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewBuilder", reflect.TypeOf((*MockBuilderFactory)(nil).NewBuilder), arg0, arg1)
}
919457
func NewPersonJSONBuilder() *PersonJSONBuilder {
	jb := &PersonJSONBuilder{
		_properties:        map[string]*PersonPropertyInfo{},
		_jsonPropertyMap:   map[string]*PersonPropertyInfo{},
		_structPropertyMap: map[string]*PersonPropertyInfo{},
		Name: &PersonPropertyInfo{
			fieldName: "Name",
			jsonName:  "name",
			Encoder: func(src *Person, dest *PersonJSON) error {
				if src == nil {
					return nil
				}
				dest.Name = src.Name
				return nil
			},
			Decoder: func(src *PersonJSON, dest *Person) error {
				if src == nil {
					return nil
				}
				dest.Name = src.Name
				return nil
			},
		},
		Age: &PersonPropertyInfo{
			fieldName: "Age",
			jsonName:  "age",
			Encoder: func(src *Person, dest *PersonJSON) error {
				if src == nil {
					return nil
				}
				dest.Age = src.Age
				return nil
			},
			Decoder: func(src *PersonJSON, dest *Person) error {
				if src == nil {
					return nil
				}
				dest.Age = src.Age
				return nil
			},
		},
		Password: &PersonPropertyInfo{
			fieldName: "Password",
			jsonName:  "password",
			Encoder: func(src *Person, dest *PersonJSON) error {
				if src == nil {
					return nil
				}
				dest.Password = src.Password
				return nil
			},
			Decoder: func(src *PersonJSON, dest *Person) error {
				if src == nil {
					return nil
				}
				dest.Password = src.Password
				return nil
			},
		},
	}
	jb._structPropertyMap["Name"] = jb.Name
	jb._jsonPropertyMap["name"] = jb.Name
	jb._structPropertyMap["Age"] = jb.Age
	jb._jsonPropertyMap["age"] = jb.Age
	jb._structPropertyMap["Password"] = jb.Password
	jb._jsonPropertyMap["password"] = jb.Password
	return jb
}
195419
func NewConnectionStringBuilder(endpoint, region, dbUser, dbName string, creds *credentials.Credentials) ConnectionStringBuilder {
	return ConnectionStringBuilder{
		dbName:   dbName,
		endpoint: endpoint,
		region:   region,
		user:     dbUser,
		creds:    creds,
	}
}
285287
func NewBuilderID(v1Bucket, builder string) (bid BuilderID) {
	bid.Project, bid.Bucket = deprecated.BucketNameToV2(v1Bucket)
	bid.Builder = builder
	return
}
180388
func (c *Client) Builder() (packer.Builder, error) {
	client, err := c.packrpcClient()
	if err != nil {
		return nil, err
	}

	return &cmdBuilder{client.Builder(), c}, nil
}
1311638
func NewBuilderFile(opts *Options, loc *Location) *BuilderFile {
	b := &BuilderFile{opts: opts, loc: loc}
	b.clear()
	return b
}
1287965
func New() *Builder {
	c := build.Default
	if c.GOROOT == "" {
		if p, err := exec.Command("which", "go").CombinedOutput(); err == nil {
			// The returned string will have some/path/bin/go, so remove the last two elements.
			c.GOROOT = filepath.Dir(filepath.Dir(strings.Trim(string(p), "\n")))
		} else {
			klog.Warningf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err)
		}
	}
	// Force this to off, since we don't properly parse CGo.  All symbols must
	// have non-CGo equivalents.
	c.CgoEnabled = false
	return &Builder{
		context:               &c,
		buildPackages:         map[string]*build.Package{},
		typeCheckedPackages:   map[importPathString]*tc.Package{},
		fset:                  token.NewFileSet(),
		parsed:                map[importPathString][]parsedFile{},
		absPaths:              map[importPathString]string{},
		userRequested:         map[importPathString]bool{},
		endLineToCommentGroup: map[fileLine]*ast.CommentGroup{},
		importGraph:           map[importPathString]map[string]struct{}{},
	}
}
852151
func NewBuildError(name string, err error) error {
	return Error{
		Message:    fmt.Sprintf("building %s failed", name),
		Details:    err,
		ErrorCode:  BuildError,
		Suggestion: "check the build output for errors",
	}
}
71212
func New(ctx context.Context, path string) *Builder {
	return &Builder{
		Context:        ctx,
		RootPath:       path,
		IgnoredBoxes:   []string{},
		IgnoredFolders: []string{"vendor", ".git", "node_modules", ".idea"},
		pkgs:           map[string]pkg{},
		moot:           &sync.Mutex{},
	}
}
1266336
func NewBuildMutator(build *buildapi.Build) ImageReferenceMutator {
	return &buildSpecMutator{
		spec:   &build.Spec.CommonSpec,
		path:   field.NewPath("spec"),
		output: true,
	}
}
644500
func builder(jobs <-chan string, buildStarted chan<- string, buildDone chan<- bool) {
	createThreshold := func() <-chan time.Time {
		return time.After(time.Duration(WorkDelay * time.Millisecond))
	}

	threshold := createThreshold()
	eventPath := ""

	for {
		select {
		case eventPath = <-jobs:
			threshold = createThreshold()
		case <-threshold:
			buildStarted <- eventPath
			buildDone <- build()
		}
	}
}
659882
func NewBuildConfigReactor(instantiator BuildConfigInstantiator, restclient rest.Interface) trigger.ImageReactor {
	eventBroadcaster := record.NewBroadcaster()
	eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(restclient).Events("")})
	eventRecorder := eventBroadcaster.NewRecorder(legacyscheme.Scheme, clientv1.EventSource{Component: "buildconfig-controller"})

	return &buildConfigReactor{instantiator: instantiator, eventRecorder: eventRecorder}
}
132283
func (c *config) LoadBuilder(name string) (packer.Builder, error) {
	log.Printf("Loading builder: %s\n", name)
	bin, ok := c.Builders[name]
	if !ok {
		log.Printf("Builder not found: %s\n", name)
		return nil, nil
	}

	return c.pluginClient(bin).Builder()
}
26683
func NewBuilder(flags Flags) (*Builder, error) {
	// We expect all flags to be parsed and flags.Args to be empty.
	// Therefore, we bail if we find unparsed args.
	if len(flags.Args) > 0 {
		return nil, fmt.Errorf("config: Unknown extra arguments: %v", flags.Args)
	}

	newSource := func(name string, v interface{}) Source {
		b, err := json.MarshalIndent(v, "", "    ")
		if err != nil {
			panic(err)
		}
		return Source{Name: name, Format: "json", Data: string(b)}
	}

	b := &Builder{
		Flags: flags,
		Head:  []Source{DefaultSource()},
	}

	if b.boolVal(b.Flags.DevMode) {
		b.Head = append(b.Head, DevSource())
	}

	// Since the merge logic is to overwrite all fields with later
	// values except slices which are merged by appending later values
	// we need to merge all slice values defined in flags before we
	// merge the config files since the flag values for slices are
	// otherwise appended instead of prepended.
	slices, values := b.splitSlicesAndValues(b.Flags.Config)
	b.Head = append(b.Head, newSource("flags.slices", slices))
	for _, path := range b.Flags.ConfigFiles {
		sources, err := b.ReadPath(path)
		if err != nil {
			return nil, err
		}
		b.Sources = append(b.Sources, sources...)
	}
	b.Tail = append(b.Tail, newSource("flags.values", values))
	for i, s := range b.Flags.HCL {
		b.Tail = append(b.Tail, Source{
			Name:   fmt.Sprintf("flags-%d.hcl", i),
			Format: "hcl",
			Data:   s,
		})
	}
	b.Tail = append(b.Tail, NonUserSource(), DefaultConsulSource(), DefaultEnterpriseSource(), DefaultVersionSource())
	if b.boolVal(b.Flags.DevMode) {
		b.Tail = append(b.Tail, DevConsulSource())
	}
	return b, nil
}
723278
func NewFugaJSONBuilder() *FugaJSONBuilder {
	jb := &FugaJSONBuilder{
		_properties:        map[string]*FugaPropertyInfo{},
		_jsonPropertyMap:   map[string]*FugaPropertyInfo{},
		_structPropertyMap: map[string]*FugaPropertyInfo{},
		Fuga1: &FugaPropertyInfo{
			fieldName: "Fuga1",
			jsonName:  "fuga1",
			Encoder: func(src *Fuga, dest *FugaJSON) error {
				if src == nil {
					return nil
				}
				dest.Fuga1 = src.Fuga1
				return nil
			},
			Decoder: func(src *FugaJSON, dest *Fuga) error {
				if src == nil {
					return nil
				}
				dest.Fuga1 = src.Fuga1
				return nil
			},
		},
	}
	jb._structPropertyMap["Fuga1"] = jb.Fuga1
	jb._jsonPropertyMap["fuga1"] = jb.Fuga1
	return jb
}
504625
func NewMockBuilder(ctrl *gomock.Controller) *MockBuilder {
	mock := &MockBuilder{ctrl: ctrl}
	mock.recorder = &MockBuilderMockRecorder{mock}
	return mock
}
669015
func (s *CreatePlatformVersionOutput) SetBuilder(v *Builder) *CreatePlatformVersionOutput {
	s.Builder = v
	return s
}