diff pkg/common/attributes.go @ 2051:7d627258e045 unify_imports

Imports: Re-enabled /imports/config POST.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 27 Jan 2019 22:40:32 +0100
parents 78002c5e838c
children ae0021feaac8
line wrap: on
line diff
--- a/pkg/common/attributes.go	Sun Jan 27 22:03:46 2019 +0100
+++ b/pkg/common/attributes.go	Sun Jan 27 22:40:32 2019 +0100
@@ -35,6 +35,17 @@
 	}
 )
 
+func (ca Attributes) Marshal(src interface{}) error {
+	if ca == nil {
+		return nil
+	}
+	var err error
+	if m, ok := src.(AttributesMarshaler); ok {
+		err = m.MarshalAttributes(ca)
+	}
+	return err
+}
+
 func (ca Attributes) Unmarshal(dst interface{}) error {
 	if ca == nil {
 		return nil