update golangci
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2023-06-04 18:51:00 +03:00
parent e1dfdc28ff
commit d839e1ac90
21 changed files with 145 additions and 106 deletions

View File

@@ -44,16 +44,16 @@ func (p *Provider) Name() string {
}
func (p *Provider) Read(ctx context.Context, key config.Key) (config.Variable, error) {
k := p.key(ctx, key)
name := p.key(ctx, key)
resp, err := p.client.Get(ctx, k, client.WithPrefix())
resp, err := p.client.Get(ctx, name, client.WithPrefix())
if err != nil {
return config.Variable{}, fmt.Errorf("%w: key:%s, prov:%s", err, k, p.Name())
return config.Variable{}, fmt.Errorf("%w: key:%s, prov:%s", err, name, p.Name())
}
val, err := p.resolve(k, resp.Kvs)
val, err := p.resolve(name, resp.Kvs)
if err != nil {
return config.Variable{}, fmt.Errorf("%w: key:%s, prov:%s", err, k, p.Name())
return config.Variable{}, fmt.Errorf("%w: key:%s, prov:%s", err, name, p.Name())
}
return val, nil
@@ -94,6 +94,7 @@ func (p *Provider) resolve(key string, kvs []*pb.KeyValue) (config.Variable, err
return config.Variable{
Name: key,
Provider: p.Name(),
Value: nil,
}, nil
case string(kv.Key) == key:
return config.Variable{
@@ -104,8 +105,5 @@ func (p *Provider) resolve(key string, kvs []*pb.KeyValue) (config.Variable, err
}
}
return config.Variable{
Name: key,
Provider: p.Name(),
}, config.ErrVariableNotFound
return config.Variable{}, fmt.Errorf("%w: name %s", config.ErrVariableNotFound, key)
}