// DeepCopy creates a new Locks that represents the same information as the
// receiver but does not share memory for any parts of the structure that.
// are mutable through methods on Locks.
//
// Note that this does _not_ create deep copies of parts of the structure
// that are technically mutable but are immutable by convention, such as the
// array underlying the slice of version constraints. Callers may mutate the
// resulting data structure only via the direct methods of Locks.
DeepCopy creates a new Locks that represents the same information as the
receiver but does not share memory for any parts of the structure that.
are mutable through methods on Locks.

Note that this does _not_ create deep copies of parts of the structure
that are technically mutable but are immutable by convention, such as the
array underlying the slice of version constraints. Callers may mutate the
resulting data structure only via the direct methods of Locks.
// DeepCopy creates a new Locks that represents the same information as the // receiver but does not share memory for any parts of the structure that . // are mutable through methods on Locks . // // Note that this does _not_ create deep copies of parts of the structure // that are technically mutable but are immutable by convention such as the // array underlying the slice of version constraints . Callers may mutate the // resulting data structure only via the direct methods of Locks .
func (l *Locks) DeepCopy() *Locks {
	ret := NewLocks()
	for addr, lock := range l.providers {
		var hashes []getproviders.Hash
		if len(lock.hashes) > 0 {
			hashes = make([]getproviders.Hash, len(lock.hashes))
			copy(hashes, lock.hashes)
		}
		ret.SetProvider(addr, lock.version, lock.versionConstraints, hashes)
	}
	return ret
}
func ( l * Locks ) DeepCopy ( ) * Locks { ret := NewLocks ( ) for addr , lock := range l . providers { var hashes [ ] getproviders . Hash if len ( lock . hashes ) > 0 { hashes = make ( [ ] getproviders . Hash , len ( lock . hashes ) ) copy ( hashes , lock . hashes ) } ret . SetProvider ( addr , lock . version , lock . versionConstraints , hashes ) } return ret }
DeepCopy creates a new Locks that represents the same information as the
receiver but does not share memory for any parts of the structure that.
DeepCopy creates a new Locks that represents the same information as the receiver but does not share memory for any parts of the structure that .