fixup! chore: bump golangci-lint from v1.24 to v1.39

Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
Yoan Blanc
2021-04-03 13:41:05 +02:00
parent 4a1392aaec
commit 3bfde04f40
6 changed files with 12 additions and 15 deletions

View File

@@ -720,7 +720,7 @@ func (c *Client) doRequest(r *request) (time.Duration, *http.Response, error) {
}
start := time.Now()
resp, err := c.httpClient.Do(req)
diff := time.Now().Sub(start)
diff := time.Since(start)
// If the response is compressed, we swap the body's reader.
if resp != nil && resp.Header != nil {

View File

@@ -120,7 +120,7 @@ func (v *CSIVolumes) CreateSnapshot(snap *CSISnapshot, w *WriteOptions) ([]*CSIS
Snapshots: []*CSISnapshot{snap},
}
resp := &CSISnapshotCreateResponse{}
meta, err := v.client.write(fmt.Sprintf("/v1/volumes/snapshot"), req, resp, w)
meta, err := v.client.write("/v1/volumes/snapshot", req, resp, w)
return resp.Snapshots, meta, err
}
@@ -129,7 +129,7 @@ func (v *CSIVolumes) DeleteSnapshot(snap *CSISnapshot, w *WriteOptions) error {
req := &CSISnapshotDeleteRequest{
Snapshots: []*CSISnapshot{snap},
}
_, err := v.client.delete(fmt.Sprintf("/v1/volumes/snapshot"), req, w)
_, err := v.client.delete("/v1/volumes/snapshot", req, w)
return err
}

View File

@@ -691,9 +691,7 @@ func (m *Multiregion) Copy() *Multiregion {
copyRegion := new(MultiregionRegion)
copyRegion.Name = region.Name
copyRegion.Count = intToPtr(*region.Count)
for _, dc := range region.Datacenters {
copyRegion.Datacenters = append(copyRegion.Datacenters, dc)
}
copyRegion.Datacenters = append(copyRegion.Datacenters, region.Datacenters...)
for k, v := range region.Meta {
copyRegion.Meta[k] = v
}

View File

@@ -224,8 +224,7 @@ func (n *Nodes) monitorDrainNode(ctx context.Context, nodeID string,
}
if node.DrainStrategy == nil {
var msg *MonitorMessage
msg = Messagef(MonitorMsgLevelInfo, "Drain complete for node %s", nodeID)
msg := Messagef(MonitorMsgLevelInfo, "Drain complete for node %s", nodeID)
select {
case nodeCh <- msg:
case <-ctx.Done():

View File

@@ -24,9 +24,9 @@ func (s *Scaling) ListPolicies(q *QueryOptions) ([]*ScalingPolicyListStub, *Quer
return resp, qm, nil
}
func (s *Scaling) GetPolicy(ID string, q *QueryOptions) (*ScalingPolicy, *QueryMeta, error) {
func (s *Scaling) GetPolicy(id string, q *QueryOptions) (*ScalingPolicy, *QueryMeta, error) {
var policy ScalingPolicy
qm, err := s.client.query("/v1/scaling/policy/"+ID, &policy, q)
qm, err := s.client.query("/v1/scaling/policy/"+id, &policy, q)
if err != nil {
return nil, nil, err
}

View File

@@ -165,12 +165,12 @@ type Affinity struct {
Weight *int8 `hcl:"weight,optional"` // Weight applied to nodes that match the affinity. Can be negative
}
func NewAffinity(LTarget string, Operand string, RTarget string, Weight int8) *Affinity {
func NewAffinity(lTarget string, operand string, rTarget string, weight int8) *Affinity {
return &Affinity{
LTarget: LTarget,
RTarget: RTarget,
Operand: Operand,
Weight: int8ToPtr(Weight),
LTarget: lTarget,
RTarget: rTarget,
Operand: operand,
Weight: int8ToPtr(weight),
}
}