feat: replace github.com/pkg/errors to errors

Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
haoyun
2022-01-07 10:19:31 +08:00
parent 3ccd43c8f6
commit bbe46b8c43
299 changed files with 1896 additions and 1874 deletions

View File

@@ -18,6 +18,7 @@ package logging
import (
"context"
"errors"
"fmt"
"net"
"os"
@@ -25,7 +26,6 @@ import (
"syscall"
"github.com/Microsoft/go-winio"
"github.com/pkg/errors"
)
// Run the logging driver
@@ -53,19 +53,19 @@ func runInternal(fn LoggerFunc) error {
return errors.New("'CONTAINER_STDOUT' environment variable missing")
}
if sout, err = winio.DialPipeContext(ctx, soutPipe); err != nil {
return errors.Wrap(err, "unable to dial stdout pipe")
return fmt.Errorf("unable to dial stdout pipe: %w", err)
}
if serrPipe, ok = os.LookupEnv("CONTAINER_STDERR"); !ok {
return errors.New("'CONTAINER_STDERR' environment variable missing")
}
if serr, err = winio.DialPipeContext(ctx, serrPipe); err != nil {
return errors.Wrap(err, "unable to dial stderr pipe")
return fmt.Errorf("unable to dial stderr pipe: %w", err)
}
waitPipe = os.Getenv("CONTAINER_WAIT")
if wait, err = winio.DialPipeContext(ctx, waitPipe); err != nil {
return errors.Wrap(err, "unable to dial wait pipe")
return fmt.Errorf("unable to dial wait pipe: %w", err)
}
config := &Config{