update deps
Some checks failed
build / test (push) Failing after 1m6s
codeql / analyze (go) (push) Failing after 1m50s
build / lint (push) Successful in 9m21s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-03-06 17:32:33 +03:00
parent f8f36b157f
commit 4bee1a7041
3 changed files with 13 additions and 21 deletions

View File

@@ -4,10 +4,9 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"github.com/imdario/mergo"
"dario.cat/mergo"
"go.unistack.org/micro/v3/codec"
"go.unistack.org/micro/v3/config"
rutil "go.unistack.org/micro/v3/util/reflect"
@@ -70,7 +69,7 @@ func (c *fileConfig) Load(ctx context.Context, opts ...config.LoadOption) error
}
}
fp, err := os.OpenFile(path, os.O_RDONLY, os.FileMode(0400))
fp, err := os.OpenFile(path, os.O_RDONLY, os.FileMode(0o400))
if err != nil {
if !c.opts.AllowFail {
return fmt.Errorf("file load path %s error: %w", path, err)
@@ -84,7 +83,7 @@ func (c *fileConfig) Load(ctx context.Context, opts ...config.LoadOption) error
defer fp.Close()
buf, err := ioutil.ReadAll(io.LimitReader(fp, int64(codec.DefaultMaxMsgSize)))
buf, err := io.ReadAll(io.LimitReader(fp, int64(codec.DefaultMaxMsgSize)))
if err != nil {
if !c.opts.AllowFail {
return err
@@ -162,7 +161,7 @@ func (c *fileConfig) Save(ctx context.Context, opts ...config.SaveOption) error
return nil
}
fp, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, os.FileMode(0600))
fp, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE, os.FileMode(0o600))
if err != nil {
if !c.opts.AllowFail {
return err