update golangci
This commit is contained in:
@@ -24,16 +24,16 @@ func NewFile(file string, opts ...Option) (*Provider, error) {
|
||||
type Option func(*Provider)
|
||||
|
||||
func configure(tree *toml.Tree, opts ...Option) *Provider {
|
||||
p := &Provider{
|
||||
prov := &Provider{
|
||||
tree: tree,
|
||||
key: key.Name,
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
opt(p)
|
||||
opt(prov)
|
||||
}
|
||||
|
||||
return p
|
||||
return prov
|
||||
}
|
||||
|
||||
func New(data []byte, opts ...Option) (*Provider, error) {
|
||||
|
||||
@@ -30,11 +30,11 @@ func (s Value) ParseInt() (int, error) {
|
||||
func (s Value) Unmarshal(target interface{}) error {
|
||||
b, err := json.Marshal(s.Raw())
|
||||
if err != nil {
|
||||
return fmt.Errorf("%w: %s", config.ErrInvalidValue, err)
|
||||
return fmt.Errorf("%w: %w", config.ErrInvalidValue, err)
|
||||
}
|
||||
|
||||
if err := json.Unmarshal(b, target); err != nil {
|
||||
return fmt.Errorf("%w: %s", config.ErrInvalidValue, err)
|
||||
return fmt.Errorf("%w: %w", config.ErrInvalidValue, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user