Copyright 2013 Dario Castañé. All rights reserved. Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Based on src/pkg/reflect/deepequal.go from official golang's stdlib.
Traverses recursively both values, assigning src's fields values to dst. The map argument tracks comparisons that have already been seen, which allows short circuiting on recursive types.
Merge will fill any empty for value type attributes on the dst struct using corresponding src attributes if they themselves are not empty. dst and src must be valid same-type structs and dst must be a pointer to struct. It won't merge unexported (private) fields and will do recursively any exported field.
MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by non-empty src attribute values. Deprecated: use Merge(…) with WithOverride
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.