changeset 1330:785f14264426

Follow the rules for error messages to make golint happy.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 25 Nov 2018 17:11:13 +0100
parents ea2143adc6d3
children 275ead19b9fd
files pkg/imports/sr.go pkg/models/sr.go
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/sr.go	Sun Nov 25 17:05:19 2018 +0100
+++ b/pkg/imports/sr.go	Sun Nov 25 17:11:13 2018 +0100
@@ -204,7 +204,7 @@
 	}
 
 	if len(xyz) == 0 {
-		return errors.New("XYZ does not contain any vertices.")
+		return errors.New("XYZ does not contain any vertices")
 	}
 
 	// Is there a boundary shapefile in the ZIP archive?
--- a/pkg/models/sr.go	Sun Nov 25 17:05:19 2018 +0100
+++ b/pkg/models/sr.go	Sun Nov 25 17:11:13 2018 +0100
@@ -83,11 +83,11 @@
 		m.DepthReference).Scan(&b)
 	switch {
 	case err == sql.ErrNoRows:
-		errs = append(errs, fmt.Errorf("Unknown depth reference '%s'\n", m.DepthReference))
+		errs = append(errs, fmt.Errorf("unknown depth reference '%s'", m.DepthReference))
 	case err != nil:
 		errs = append(errs, err)
 	case !b:
-		errs = append(errs, errors.New("Unexpected depth reference"))
+		errs = append(errs, errors.New("unexpected depth reference"))
 	}
 
 	err = conn.QueryRowContext(ctx,
@@ -95,7 +95,7 @@
 		m.Bottleneck).Scan(&b)
 	switch {
 	case err == sql.ErrNoRows:
-		errs = append(errs, fmt.Errorf("Unknown bottleneck '%s'\n", m.Bottleneck))
+		errs = append(errs, fmt.Errorf("unknown bottleneck '%s'", m.Bottleneck))
 	case err != nil:
 		errs = append(errs, err)
 	case !b: