comparison pkg/imports/gm.go @ 3718:7431c6680b90

import: Trim whitespaces in ISRS code and improved log messsage.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 20 Jun 2019 15:26:17 +0200
parents d4a8d084eab4
children 9759355d7b90
comparison
equal deleted inserted replaced
3717:eab5e934c37d 3718:7431c6680b90
361 361
362 var gids []string 362 var gids []string
363 for _, msg := range result { 363 for _, msg := range result {
364 for _, wrm := range msg.Wrm { 364 for _, wrm := range msg.Wrm {
365 curr := string(*wrm.Geo_object.Id) 365 curr := string(*wrm.Geo_object.Id)
366 curr = strings.TrimSpace(curr)
366 currIsrs, err := models.IsrsFromString(curr) 367 currIsrs, err := models.IsrsFromString(curr)
367 if err != nil { 368 if err != nil {
368 feedback.Warn("Invalid ISRS code %v", err) 369 feedback.Warn("Invalid ISRS code %v", err)
369 continue 370 continue
370 } 371 }
371 feedback.Info("Found measurements/predictions for %s", curr) 372 feedback.Info("Found measurements/predictions for %s", curr)
372 if !isKnown(curr) { 373 if !isKnown(curr) {
373 feedback.Warn("Cannot import data for %s", curr) 374 feedback.Warn("Cannot find gauge %q for import", curr)
374 continue 375 continue
375 } 376 }
376 377
377 var referenceCode string 378 var referenceCode string
378 if wrm.Reference_code == nil { 379 if wrm.Reference_code == nil {