changeset 4163:51cfa54fc5b1

Made 'golint' and 'staticcheck' happy with geoserver package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 02 Aug 2019 18:01:32 +0200
parents 8c5df0f3562e
children 6f9d00c8cc38
files pkg/geoserver/boot.go
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/geoserver/boot.go	Fri Aug 02 17:53:18 2019 +0200
+++ b/pkg/geoserver/boot.go	Fri Aug 02 18:01:32 2019 +0200
@@ -115,7 +115,7 @@
 	}
 
 	if resp.StatusCode != http.StatusCreated {
-		err = fmt.Errorf("Status code '%s' (%d)",
+		err = fmt.Errorf("status code '%s' (%d)",
 			http.StatusText(resp.StatusCode),
 			resp.StatusCode)
 	}
@@ -197,7 +197,7 @@
 	}
 
 	if resp.StatusCode != http.StatusCreated {
-		err = fmt.Errorf("Status code '%s' (%d)",
+		err = fmt.Errorf("status code '%s' (%d)",
 			http.StatusText(resp.StatusCode),
 			resp.StatusCode)
 	}
@@ -311,7 +311,7 @@
 		}
 
 		if resp.StatusCode != http.StatusCreated {
-			return fmt.Errorf("Status code '%s' (%d)",
+			return fmt.Errorf("status code '%s' (%d)",
 				http.StatusText(resp.StatusCode),
 				resp.StatusCode)
 		}
@@ -397,12 +397,17 @@
 	stylePreprocessors   = map[string]func(string) (string, error){}
 )
 
+// RegisterStylePreprocessor stores a textual pre-processor
+// for a given style to be applied when the value of the
+// style changes.
 func RegisterStylePreprocessor(name string, processor func(string) (string, error)) {
 	stylePreprocessorsMu.Lock()
 	defer stylePreprocessorsMu.Unlock()
 	stylePreprocessors[name] = processor
 }
 
+// FindStylePreprocessor searches for a registed textual pre-processor
+// associated with a given style name.
 func FindStylePreprocessor(name string) func(string) (string, error) {
 	stylePreprocessorsMu.Lock()
 	defer stylePreprocessorsMu.Unlock()
@@ -468,7 +473,7 @@
 		}
 
 		if resp.StatusCode != http.StatusCreated {
-			return fmt.Errorf("Unable to create style %s (%s)",
+			return fmt.Errorf("unable to create style %s (%s)",
 				entry.Name,
 				http.StatusText(resp.StatusCode))
 		}