Mercurial > gemma
diff pkg/common/attributes.go @ 2047:78002c5e838c unify_imports
Imports: Code simplification.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 25 Jan 2019 18:24:14 +0100 |
parents | 74e24ae3205a |
children | 7d627258e045 |
line wrap: on
line diff
--- a/pkg/common/attributes.go Fri Jan 25 18:17:37 2019 +0100 +++ b/pkg/common/attributes.go Fri Jan 25 18:24:14 2019 +0100 @@ -35,6 +35,17 @@ } ) +func (ca Attributes) Unmarshal(dst interface{}) error { + if ca == nil { + return nil + } + var err error + if um, ok := dst.(AttributesUnmarshaler); ok { + err = um.UnmarshalAttributes(ca) + } + return err +} + func (ca Attributes) Delete(key string) bool { if ca == nil { return false