changeset 4799:f32d086b5dbf

Removed the mechanical touch of the last commit.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 25 Oct 2019 18:40:37 +0200
parents ca6a5f722471
children 37429e50a74f
files pkg/imports/dma.go pkg/imports/dmv.go pkg/imports/dsr.go pkg/imports/fa.go pkg/imports/fd.go pkg/imports/gm.go pkg/imports/sec.go pkg/imports/wa.go pkg/imports/wg.go pkg/imports/wp.go pkg/imports/wx.go
diffstat 11 files changed, 20 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/dma.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/dma.go	Fri Oct 25 18:40:37 2019 +0200
@@ -20,7 +20,6 @@
 	"errors"
 	"fmt"
 	"io"
-	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/wfs"
@@ -43,12 +42,7 @@
 }
 
 func (dma *DistanceMarksAshore) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, dma.URL)
-	descs = append(descs, dma.FeatureType)
-	return strings.Join(descs, "|"), nil
+	return dma.URL + "|" + dma.FeatureType, nil
 }
 
 // DMAJobKind is the import queue type identifier.
--- a/pkg/imports/dmv.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/dmv.go	Fri Oct 25 18:40:37 2019 +0200
@@ -17,7 +17,6 @@
 	"context"
 	"database/sql"
 	"errors"
-	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/models"
@@ -38,11 +37,7 @@
 }
 
 func (dmv *DistanceMarksVirtual) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, dmv.URL)
-	return strings.Join(descs, "|"), nil
+	return dmv.URL, nil
 }
 
 // DMVJobKind is the import queue type identifier.
--- a/pkg/imports/dsr.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/dsr.go	Fri Oct 25 18:40:37 2019 +0200
@@ -1,4 +1,3 @@
-// This is Free Software under GNU Affero General Public License v >= 3.0
 // without warranty, see README.md and license for details.
 //
 // SPDX-License-Identifier: AGPL-3.0-or-later
@@ -18,7 +17,6 @@
 	"context"
 	"database/sql"
 	"errors"
-	"strings"
 
 	"gemma.intevation.de/gemma/pkg/common"
 	"gemma.intevation.de/gemma/pkg/models"
@@ -31,12 +29,7 @@
 }
 
 func (dsr *DeleteSoundingResult) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, dsr.BottleneckId)
-	descs = append(descs, dsr.Date.Format(common.DateFormat))
-	return strings.Join(descs, "|"), nil
+	return dsr.BottleneckId + "|" + dsr.Date.Format(common.DateFormat), nil
 }
 
 // DSRJobKind is the import queue type identifier.
--- a/pkg/imports/fa.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/fa.go	Fri Oct 25 18:40:37 2019 +0200
@@ -21,7 +21,6 @@
 	"errors"
 	"fmt"
 	"sort"
-	"strings"
 	"time"
 
 	"github.com/jackc/pgx/pgtype"
@@ -162,11 +161,7 @@
 )
 
 func (fa *FairwayAvailability) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, fa.URL)
-	return strings.Join(descs, "|"), nil
+	return fa.URL, nil
 }
 
 type faJobCreator struct{}
--- a/pkg/imports/fd.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/fd.go	Fri Oct 25 18:40:37 2019 +0200
@@ -48,13 +48,11 @@
 }
 
 func (fd *FairwayDimension) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, fd.URL)
-	descs = append(descs, fd.FeatureType)
-	descs = append(descs, fmt.Sprintf("LOS%d", fd.LOS))
-	return strings.Join(descs, "|"), nil
+	return strings.Join([]string{
+		fd.URL,
+		fd.FeatureType,
+		fmt.Sprintf("LOS%d", fd.LOS),
+	}, "|"), nil
 }
 
 type fdTime struct{ time.Time }
--- a/pkg/imports/gm.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/gm.go	Fri Oct 25 18:40:37 2019 +0200
@@ -41,11 +41,7 @@
 }
 
 func (gm *GaugeMeasurement) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, gm.URL)
-	return strings.Join(descs, "|"), nil
+	return gm.URL, nil
 }
 
 // GMJobKind is the import queue type identifier.
--- a/pkg/imports/sec.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/sec.go	Fri Oct 25 18:40:37 2019 +0200
@@ -35,14 +35,12 @@
 }
 
 func (sec *Section) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, sec.Name)
-	descs = append(descs, sec.ObjNam)
-	descs = append(descs, sec.From.String())
-	descs = append(descs, sec.To.String())
-	return strings.Join(descs, "|"), nil
+	return strings.Join([]string{
+		sec.Name,
+		sec.ObjNam,
+		sec.From.String(),
+		sec.To.String(),
+	}, "|"), nil
 }
 
 // SECJobKind is the import queue type identifier.
--- a/pkg/imports/wa.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/wa.go	Fri Oct 25 18:40:37 2019 +0200
@@ -22,7 +22,6 @@
 	"fmt"
 	"io"
 	"strconv"
-	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/pgxutils"
@@ -47,12 +46,7 @@
 }
 
 func (wa *WaterwayArea) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, wa.URL)
-	descs = append(descs, wa.FeatureType)
-	return strings.Join(descs, "|"), nil
+	return wa.URL + "|" + wa.FeatureType, nil
 }
 
 // WAJobKind is the import queue type identifier.
--- a/pkg/imports/wg.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/wg.go	Fri Oct 25 18:40:37 2019 +0200
@@ -17,7 +17,6 @@
 import (
 	"context"
 	"database/sql"
-	"strings"
 	"time"
 
 	"github.com/jackc/pgx/pgtype"
@@ -42,11 +41,7 @@
 }
 
 func (wg *WaterwayGauge) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, wg.URL)
-	return strings.Join(descs, "|"), nil
+	return wg.URL, nil
 }
 
 // WGJobKind is the unique name of this import job type.
--- a/pkg/imports/wp.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/wp.go	Fri Oct 25 18:40:37 2019 +0200
@@ -60,12 +60,7 @@
 }
 
 func (wp *WaterwayProfiles) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, wp.URL)
-	descs = append(descs, wp.FeatureType)
-	return strings.Join(descs, "|"), nil
+	return wp.URL + "|" + wp.FeatureType, nil
 }
 
 // WPJobKind is the unique name of this import job type.
--- a/pkg/imports/wx.go	Fri Oct 25 18:25:38 2019 +0200
+++ b/pkg/imports/wx.go	Fri Oct 25 18:40:37 2019 +0200
@@ -21,7 +21,6 @@
 	"errors"
 	"fmt"
 	"io"
-	"strings"
 	"time"
 
 	"gemma.intevation.de/gemma/pkg/pgxutils"
@@ -46,12 +45,7 @@
 }
 
 func (wx *WaterwayAxis) Description() (string, error) {
-
-	var descs []string
-
-	descs = append(descs, wx.URL)
-	descs = append(descs, wx.FeatureType)
-	return strings.Join(descs, "|"), nil
+	return wx.URL + "|" + wx.FeatureType, nil
 }
 
 // WXJobKind is the import queue type identifier.