//Copy copies entity source to the generated body applying
//type conversion rules and correct packages aliases
349828
func (g *Generator) Copy(n interface{}) error {
	switch v := n.(type) {
	case *ast.TypeSpec:
		return g.CopyType(v)
	case *ast.ValueSpec:
		return g.CopyVal(v)
	}

	return fmt.Errorf("can't copy variable of type: %T", n)
}
1304387
func Copy(src reflect.Value) reflect.Value {
	d := make(deepcopy)
	return d.copy(src)
}
383231
func Copy(src, dest string) error {
	info, err := os.Lstat(src)
	if err != nil {
		return err
	}
	return copy(src, dest, info)
}
1175457
func (r *Resource) Copy() *Resource {
	n := &Resource{
		Mode:         r.Mode,
		Name:         r.Name,
		Type:         r.Type,
		RawCount:     r.RawCount.Copy(),
		RawConfig:    r.RawConfig.Copy(),
		Provisioners: make([]*Provisioner, 0, len(r.Provisioners)),
		Provider:     r.Provider,
		DependsOn:    make([]string, len(r.DependsOn)),
		Lifecycle:    *r.Lifecycle.Copy(),
	}
	for _, p := range r.Provisioners {
		n.Provisioners = append(n.Provisioners, p.Copy())
	}
	copy(n.DependsOn, r.DependsOn)
	return n
}
212994
func Copy(ctx context.Context, s Store, src, des Object) error {
	// for Providers that offer fast path, and use the backend copier
	if src.StorageSource() == des.StorageSource() {
		if cp, ok := s.(StoreCopy); ok {
			return cp.Copy(ctx, src, des)
		}
	}

	// Slow path, open an io.Reader from the source and copy it to an
	// io.Writer to the destination.  This is considered a "slow path" because we
	// have to act as a broker to relay bytes between the two objects.  Some
	// stores support moving data using an API call.
	fout, err := s.NewWriterWithContext(ctx, des.Name(), src.MetaData())
	if err != nil {
		gou.Warnf("Move could not open destination %v", src.Name())
		return err
	}
	fin, err := s.NewReaderWithContext(ctx, src.Name())
	if err != nil {
		gou.Warnf("Move could not open source %v err=%v", src.Name(), err)
		return err
	}
	if _, err = io.Copy(fout, fin); err != nil {
		return err
	}
	if err := fin.Close(); err != nil {
		return err
	}
	if err := fout.Close(); err != nil { //this will flush and sync the file.
		return err
	}
	return nil
}
976651
func (p *Package) Copy(name string, r io.Reader) {
	if p.err != nil {
		return
	}

	zf, err := p.z.Create(name)
	if err != nil {
		p.err = err
		return
	}

	checksum, err := copyAndChecksum(zf, r)
	if err != nil {
		p.err = err
		return
	}

	p.manifest[name] = checksum
}
972666
func (r *Request) copy() *Request {
	r.state.Lock()
	defer r.state.Unlock()
	r2 := new(Request)
	*r2 = *r
	return r2
}
1332976
func Copy(xs XStater) XStater {
	if c, ok := xs.(Copier); ok {
		return c.Copy()
	}
	return nop
}
458419
func (bj BinaryJSON) Copy() BinaryJSON {
	buf := make([]byte, len(bj.Value))
	copy(buf, bj.Value)
	return BinaryJSON{TypeCode: bj.TypeCode, Value: buf}
}
245237
func (cst *ClientSessionTransport) Copy(ctx context.Context, id fscache.RemoteIdentifier, dest string, cu filesync.CacheUpdater) error {
	csi, ok := id.(*ClientSessionSourceIdentifier)
	if !ok {
		return errors.New("invalid identifier for client session")
	}

	return filesync.FSSync(ctx, csi.caller, filesync.FSSendRequestOpt{
		IncludePatterns: csi.includePatterns,
		DestDir:         dest,
		CacheUpdater:    cu,
	})
}
538496
func (ac *ArrayComprehension) Copy() *ArrayComprehension {
	cpy := *ac
	cpy.Body = ac.Body.Copy()
	cpy.Term = ac.Term.Copy()
	return &cpy
}
608317
func (c *VaultConfig) Copy() *VaultConfig {
	if c == nil {
		return nil
	}

	nc := new(VaultConfig)
	*nc = *c
	return nc
}
1140549
func (s *State) Copy() *State {
	taskStates := make(map[string]*structs.TaskState, len(s.TaskStates))
	for k, v := range s.TaskStates {
		taskStates[k] = v.Copy()
	}
	return &State{
		ClientStatus:      s.ClientStatus,
		ClientDescription: s.ClientDescription,
		DeploymentStatus:  s.DeploymentStatus.Copy(),
		TaskStates:        taskStates,
	}
}
345467
func (c *Files) Copy(in *CopyInput) (out *CopyOutput, err error) {
	body, err := c.call("/files/copy", in)
	if err != nil {
		return
	}
	defer body.Close()

	err = json.NewDecoder(body).Decode(&out)
	return
}
1183075
func (p *Prefix) Copy() *Prefix {
	if p == nil {
		return nil
	}

	newPrefix := &Prefix{}

	*newPrefix = *p

	return newPrefix
}
1088371
func (s *VolumeSpec) Copy() *VolumeSpec {
	spec := *s
	if s.ReplicaSet != nil {
		spec.ReplicaSet = &ReplicaSet{Nodes: make([]string, len(s.ReplicaSet.Nodes))}
		copy(spec.ReplicaSet.Nodes, s.ReplicaSet.Nodes)
	}
	return &spec
}
1126743
func (mv *Validator) copy() *Validator {
	return &Validator{
		tagName:         mv.tagName,
		validationFuncs: mv.validationFuncs,
	}
}