aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/magiconair/properties/properties.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/magiconair/properties/properties.go')
-rw-r--r--vendor/github.com/magiconair/properties/properties.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go
index 884ef4e..e7e0104 100644
--- a/vendor/github.com/magiconair/properties/properties.go
+++ b/vendor/github.com/magiconair/properties/properties.go
@@ -630,6 +630,26 @@ func (p *Properties) Delete(key string) {
p.k = newKeys
}
+// Merge merges properties, comments and keys from other *Properties into p
+func (p *Properties) Merge(other *Properties) {
+ for k,v := range other.m {
+ p.m[k] = v
+ }
+ for k,v := range other.c {
+ p.c[k] = v
+ }
+
+ outer:
+ for _, otherKey := range other.k {
+ for _, key := range p.k {
+ if otherKey == key {
+ continue outer
+ }
+ }
+ p.k = append(p.k, otherKey)
+ }
+}
+
// ----------------------------------------------------------------------------
// check expands all values and returns an error if a circular reference or