Enable errcheck for golangci-lint (#19976)

* Enable `errcheck` for golangci-lint
* Fix linting errors
* pkg/plugins: Fix tests
* pkg/plugins: Add test
This commit is contained in:
Arve Knudsen
2019-10-28 17:25:35 +01:00
committed by GitHub
parent 9e004b9211
commit f9774acc4c
4 changed files with 56 additions and 18 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ package plugins
import (
"encoding/json"
"errors"
"fmt"
"strings"
@@ -61,7 +60,7 @@ type PluginBase struct {
func (pb *PluginBase) registerPlugin(pluginDir string) error {
if _, exists := Plugins[pb.Id]; exists {
return errors.New("Plugin with same id already exists")
return fmt.Errorf("Plugin with ID %q already exists", pb.Id)
}
if !strings.HasPrefix(pluginDir, setting.StaticRootPath) {