simplify debug

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-12-20 23:04:26 +03:00
parent b57c149c7f
commit 7e60b3a789

View File

@ -3,6 +3,7 @@ package file
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"os" "os"
@ -57,7 +58,7 @@ func (c *fileConfig) Load(ctx context.Context) error {
fp, err := os.OpenFile(c.path, os.O_RDONLY, os.FileMode(0400)) fp, err := os.OpenFile(c.path, os.O_RDONLY, os.FileMode(0400))
if err != nil && !c.opts.AllowFail { if err != nil && !c.opts.AllowFail {
return ErrPathNotExist return fmt.Errorf("failed to open: %s, error: %w", c.path, ErrPathNotExist)
} else if err == nil { } else if err == nil {
defer fp.Close() defer fp.Close()
var buf []byte var buf []byte