simplify debug
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
b57c149c7f
commit
7e60b3a789
3
file.go
3
file.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user