Mercurial > gemma
diff pkg/controllers/importconfig.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 | 725884a4c89a |
children | 3c4b8f4815af |
line wrap: on
line diff
--- a/pkg/controllers/importconfig.go Fri Jan 25 18:17:37 2019 +0100 +++ b/pkg/controllers/importconfig.go Fri Jan 25 18:24:14 2019 +0100 @@ -21,7 +21,6 @@ "github.com/gorilla/mux" - "gemma.intevation.de/gemma/pkg/common" "gemma.intevation.de/gemma/pkg/imports" ) @@ -240,12 +239,11 @@ Message: fmt.Sprintf("No constructor for kind '%s' found", cfg.Kind), } } + what := ctor() - if um, ok := what.(common.AttributesUnmarshaler); ok { - if err = um.UnmarshalAttributes(cfg.Attributes); err != nil { - return - } + if err = cfg.Attributes.Unmarshal(what); err != nil { + return } jr = JSONResult{Result: &imports.ImportConfigOut{