From 28cb298ab6ac5e4649daf933c50df8c7b7947198 Mon Sep 17 00:00:00 2001 From: Patroklos Papapetrou Date: Mon, 18 Oct 2021 09:29:27 +0300 Subject: [PATCH] bump golancgi linter version to the latest 1.42.1 --- .golangci.yml | 8 -------- Makefile | 2 +- internal/pkg/values/string_value.go | 5 ++++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7a8e068..e1b6a97 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,7 +13,6 @@ issues: - scopelint - funlen - maligned - - golint - paralleltest - testpackage - goerr113 @@ -46,17 +45,10 @@ linters-settings: gofmt: simplify: true - golint: - min-confidence: 0 - gocyclo: # minimal code complexity to report, 30 by default (we should lower it to around 15-17) min-complexity: 25 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - misspell: locale: neutral diff --git a/Makefile b/Makefile index ff0de26..1097491 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ deps: @ echo "-> Installing project dependencies..." @ GO111MODULE=off go get -u github.com/myitcv/gobin @ $(GOBIN)/gobin golang.org/x/lint/golint - @ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.37.0 + @ curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOBIN) v1.42.1 @ echo "-> Done." ## Formats code and fixes as many as possible linter errors diff --git a/internal/pkg/values/string_value.go b/internal/pkg/values/string_value.go index 91d963c..2d670df 100644 --- a/internal/pkg/values/string_value.go +++ b/internal/pkg/values/string_value.go @@ -171,7 +171,10 @@ func (s StringValue) AddDecorator(decorator StringDecorator) StringValue { } func (s StringValue) decoratedValue(value interface{}) string { - decoratedValue := value.(string) + decoratedValue, ok := value.(string) + if !ok { + return "" + } for _, decorator := range s.decorators { decoratedValue = decorator(decoratedValue) }