Chore: Drop xerrors dependency (#26718)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-07-31 09:45:20 +02:00
committed by GitHub
parent 5a6afd9096
commit 16c185c3b9
20 changed files with 79 additions and 61 deletions

View File

@@ -6,7 +6,6 @@ import (
"sync"
"github.com/BurntSushi/toml"
"golang.org/x/xerrors"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
@@ -136,7 +135,7 @@ func readConfig(configFile string) (*Config, error) {
}
if len(result.Servers) == 0 {
return nil, xerrors.New("LDAP enabled but no LDAP servers defined in config file")
return nil, fmt.Errorf("LDAP enabled but no LDAP servers defined in config file")
}
// set default org id
@@ -164,11 +163,11 @@ func assertNotEmptyCfg(val interface{}, propName string) error {
switch v := val.(type) {
case string:
if v == "" {
return xerrors.Errorf("LDAP config file is missing option: %v", propName)
return fmt.Errorf("LDAP config file is missing option: %q", propName)
}
case []string:
if len(v) == 0 {
return xerrors.Errorf("LDAP config file is missing option: %v", propName)
return fmt.Errorf("LDAP config file is missing option: %q", propName)
}
default:
fmt.Println("unknown")