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

@@ -2,6 +2,7 @@ package main
import (
"context"
"errors"
"flag"
"fmt"
"io/ioutil"
@@ -40,7 +41,6 @@ import (
_ "github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util/errutil"
"golang.org/x/xerrors"
)
// NewServer returns a new instance of Server.
@@ -147,7 +147,7 @@ func (s *Server) Run() (err error) {
defer func() {
s.log.Debug("Waiting on services...")
if waitErr := s.childRoutines.Wait(); waitErr != nil && !xerrors.Is(waitErr, context.Canceled) {
if waitErr := s.childRoutines.Wait(); waitErr != nil && !errors.Is(waitErr, context.Canceled) {
s.log.Error("A service failed", "err", waitErr)
if err == nil {
err = waitErr
@@ -169,7 +169,7 @@ func (s *Server) Shutdown(reason string) {
s.shutdownFn()
// wait for child routines
if err := s.childRoutines.Wait(); err != nil && !xerrors.Is(err, context.Canceled) {
if err := s.childRoutines.Wait(); err != nil && !errors.Is(err, context.Canceled) {
s.log.Error("Failed waiting for services to shutdown", "err", err)
}
}