Simplify string(buf.Bytes()) to buf.String() (#3590)
This commit is contained in:
parent
e6a4efa67b
commit
7d698c0a10
|
@ -252,7 +252,7 @@ func (k *KV) put(key string, params map[string]string, body []byte, q *WriteOpti
|
||||||
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
||||||
return false, nil, fmt.Errorf("Failed to read response: %v", err)
|
return false, nil, fmt.Errorf("Failed to read response: %v", err)
|
||||||
}
|
}
|
||||||
res := strings.Contains(string(buf.Bytes()), "true")
|
res := strings.Contains(buf.String(), "true")
|
||||||
return res, qm, nil
|
return res, qm, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ func (k *KV) deleteInternal(key string, params map[string]string, q *WriteOption
|
||||||
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
||||||
return false, nil, fmt.Errorf("Failed to read response: %v", err)
|
return false, nil, fmt.Errorf("Failed to read response: %v", err)
|
||||||
}
|
}
|
||||||
res := strings.Contains(string(buf.Bytes()), "true")
|
res := strings.Contains(buf.String(), "true")
|
||||||
return res, qm, nil
|
return res, qm, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ func (op *Operator) AutopilotCASConfiguration(conf *AutopilotConfiguration, q *W
|
||||||
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
if _, err := io.Copy(&buf, resp.Body); err != nil {
|
||||||
return false, fmt.Errorf("Failed to read response: %v", err)
|
return false, fmt.Errorf("Failed to read response: %v", err)
|
||||||
}
|
}
|
||||||
res := strings.Contains(string(buf.Bytes()), "true")
|
res := strings.Contains(buf.String(), "true")
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue