Mercurial > gemma
diff pkg/imports/wa.go @ 4852:046a07a33b19
Fixed the golint issues of the imports package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 19 Nov 2019 16:08:55 +0100 |
parents | 58642179e896 |
children | 783d0bec86d3 |
line wrap: on
line diff
--- a/pkg/imports/wa.go Tue Nov 19 15:46:16 2019 +0100 +++ b/pkg/imports/wa.go Tue Nov 19 16:08:55 2019 +0100 @@ -45,6 +45,7 @@ Password string `json:"password,omitempty"` } +// Description gives a short info about relevant facts of this import. func (wa *WaterwayArea) Description() (string, error) { return wa.URL + "|" + wa.FeatureType, nil } @@ -113,7 +114,7 @@ ) // Do executes the actual waterway axis import. -func (wx *WaterwayArea) Do( +func (wa *WaterwayArea) Do( ctx context.Context, importID int64, conn *sql.Conn, @@ -124,19 +125,19 @@ feedback.Info("Import waterway area") - feedback.Info("Loading capabilities from %s", wx.URL) - caps, err := wfs.GetCapabilities(wx.URL) + feedback.Info("Loading capabilities from %s", wa.URL) + caps, err := wfs.GetCapabilities(wa.URL) if err != nil { feedback.Error("Loading capabilities failed: %v", err) return nil, err } - ft := caps.FindFeatureType(wx.FeatureType) + ft := caps.FindFeatureType(wa.FeatureType) if ft == nil { - return nil, fmt.Errorf("unknown feature type '%s'", wx.FeatureType) + return nil, fmt.Errorf("unknown feature type '%s'", wa.FeatureType) } - feedback.Info("Found feature type '%s", wx.FeatureType) + feedback.Info("Found feature type '%s", wa.FeatureType) epsg, err := wfs.CRSToEPSG(ft.DefaultCRS) if err != nil { @@ -144,11 +145,11 @@ return nil, err } - if wx.SortBy != "" { - feedback.Info("Features will be sorted by '%s'", wx.SortBy) + if wa.SortBy != "" { + feedback.Info("Features will be sorted by '%s'", wa.SortBy) } - dl, err := wfs.GetFeatures(caps, wx.FeatureType, wx.SortBy) + dl, err := wfs.GetFeatures(caps, wa.FeatureType, wa.SortBy) if err != nil { feedback.Error("Cannot create GetFeature URLs. %v", err) return nil, err @@ -179,7 +180,7 @@ features int ) - if err := dl.Download(wx.User, wx.Password, func(url string, r io.Reader) error { + if err := dl.Download(wa.User, wa.Password, func(url string, r io.Reader) error { feedback.Info("Get features from: '%s'", url) rfc, err := wfs.ParseRawFeatureCollection(r) if err != nil {