# HG changeset patch # User Sascha L. Teichmann # Date 1564761692 -7200 # Node ID 51cfa54fc5b1bbb1c21abce23dac2c1d0e1b70e2 # Parent 8c5df0f3562e6cc522646ff31dd1b3cd1464dc5c Made 'golint' and 'staticcheck' happy with geoserver package. diff -r 8c5df0f3562e -r 51cfa54fc5b1 pkg/geoserver/boot.go --- 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)) }