Mercurial > gemma
comparison pkg/imports/fm.go @ 4906:21fea90f4002 fairway-marks-import
Avoid unnecessary pointer to pointer
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 07 Feb 2020 12:35:11 +0100 |
parents | 8cb201b551b3 |
children | 644cb7c175f3 |
comparison
equal
deleted
inserted
replaced
4905:8cb201b551b3 | 4906:21fea90f4002 |
---|---|
57 | 57 |
58 // Common operation of FM imports to get features from WFS service | 58 // Common operation of FM imports to get features from WFS service |
59 func getFMFeatures( | 59 func getFMFeatures( |
60 feedback Feedback, | 60 feedback Feedback, |
61 fm FairwayMarks, | 61 fm FairwayMarks, |
62 // Constructor returning a struct representing featuretype's properties | 62 // Constructor returning pointer to struct |
63 // representing featuretype's properties | |
63 newProps func() interface{}, | 64 newProps func() interface{}, |
64 ) ( | 65 ) ( |
65 // Elements can be converted to []interface{}{p, fp} with | 66 // Elements can be converted to []interface{}{p, fp} with |
66 // p being a pointSlice and fp of the type of argument props. | 67 // p being a pointSlice and fp of the type of argument props. |
67 fms [][]interface{}, | 68 fms [][]interface{}, |
132 missingProperties++ | 133 missingProperties++ |
133 continue | 134 continue |
134 } | 135 } |
135 | 136 |
136 props := newProps() | 137 props := newProps() |
137 if err := json.Unmarshal(*feature.Properties, &props); err != nil { | 138 if err := json.Unmarshal(*feature.Properties, props); err != nil { |
138 badProperties++ | 139 badProperties++ |
139 continue | 140 continue |
140 } | 141 } |
141 | 142 |
142 switch feature.Geometry.Type { | 143 switch feature.Geometry.Type { |