Mercurial > gemma
diff pkg/imports/fm.go @ 4905:8cb201b551b3 fairway-marks-import
Replace bogus usage of pointer for type intrusion
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 07 Feb 2020 12:23:46 +0100 |
parents | 53d929f658f3 |
children | 21fea90f4002 |
line wrap: on
line diff
--- a/pkg/imports/fm.go Thu Feb 06 19:09:14 2020 +0100 +++ b/pkg/imports/fm.go Fri Feb 07 12:23:46 2020 +0100 @@ -59,8 +59,8 @@ func getFMFeatures( feedback Feedback, fm FairwayMarks, - // Pointer to a struct representing featuretype's properties - props interface{}, + // Constructor returning a struct representing featuretype's properties + newProps func() interface{}, ) ( // Elements can be converted to []interface{}{p, fp} with // p being a pointSlice and fp of the type of argument props. @@ -133,7 +133,8 @@ continue } - if err := json.Unmarshal(*feature.Properties, props); err != nil { + props := newProps() + if err := json.Unmarshal(*feature.Properties, &props); err != nil { badProperties++ continue }