changeset 2196:e57ba9585aaa

Fairway availability import: More idiomatic code / cosmetics.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 12 Feb 2019 13:04:48 +0100
parents 3437ceee1529
children 3203c53a8d29
files pkg/imports/fa.go
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/fa.go	Tue Feb 12 11:54:12 2019 +0100
+++ b/pkg/imports/fa.go	Tue Feb 12 13:04:48 2019 +0100
@@ -286,10 +286,11 @@
 
 	client := ifaf.NewFairwayAvailabilityService(fa.URL, fa.Insecure, nil)
 
-	var bnIds []string
-	for _, bn := range bottlenecks {
-		bnIds = append(bnIds, bn.ID)
+	bnIds := make([]string, len(bottlenecks))
+	for i := range bottlenecks {
+		bnIds[i] = bottlenecks[i].ID
 	}
+
 	var period ifaf.RequestedPeriod
 	period.Date_start = latestDate.Time
 	period.Date_end = time.Now()