Commit 3dca5774 authored by Cristian Maglie's avatar Cristian Maglie Committed by Cristian Maglie

Updated linter and fixed warnings

parent c428dc37
run:
skip-dirs:
- legacy
linters-settings:
govet:
check-shadowing: true
......@@ -21,6 +25,9 @@ linters-settings:
linters:
enable-all: true
disable:
- goimports
- gocritic
- gochecknoglobals
- gosec
- deadcode
- dupl
......
......@@ -10,9 +10,7 @@ env:
# build and immediately stop. It's sorta like having set -e enabled in bash.
# Make sure golangci-lint is vendored.
before_install:
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.10.2
# Download the binary to bin folder in $GOPATH
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.16.0
install: true
......
......@@ -37,18 +37,14 @@ type Formatter interface {
// PrintFunc represents a function used to print formatted data.
type PrintFunc func(Formatter, interface{}) error
var formatters map[string]Formatter
var defaultFormatter Formatter
var formatters = map[string]Formatter{
"text": &TextFormatter{},
"json": &JSONFormatter{},
}
var defaultFormatter = formatters["text"]
var logger *logrus.Logger
func init() {
formatters = make(map[string]Formatter, 2)
AddCustomFormatter("text", &TextFormatter{})
AddCustomFormatter("json", &JSONFormatter{})
defaultFormatter = formatters["text"]
}
// SetFormatter sets the defaults format to the one specified, if valid. Otherwise it returns an error.
func SetFormatter(formatName string) error {
if !IsSupported(formatName) {
......
......@@ -36,9 +36,10 @@ func TestNavigate(t *testing.T) {
"inheritance",
}
for _, tt := range tests {
t.Run(tt, func(t *testing.T) {
pwd := paths.New("testdata", "navigate", tt, "first", "second")
golden := filepath.Join("testdata", "navigate", tt, "golden.yaml")
_tt := tt
t.Run(_tt, func(t *testing.T) {
pwd := paths.New("testdata", "navigate", _tt, "first", "second")
golden := filepath.Join("testdata", "navigate", _tt, "golden.yaml")
config, _ := configs.NewConfiguration()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment