kubectl: simplify code with help of linter

This commit is contained in:
Alexander Campbell
2017-05-25 13:37:56 -07:00
parent 01ae6edc6c
commit ef9ae61240
16 changed files with 34 additions and 71 deletions

View File

@@ -116,7 +116,7 @@ func TestEdit(t *testing.T) {
if step.StepType != "edit" {
t.Fatalf("%s, step %d: expected edit step, got %s %s", name, i, req.Method, req.URL.Path)
}
if bytes.Compare(body, expectedInput) != 0 {
if !bytes.Equal(body, expectedInput) {
if updateInputFixtures {
// Convenience to allow recapturing the input and persisting it here
ioutil.WriteFile(inputFile, body, os.FileMode(0644))
@@ -139,7 +139,7 @@ func TestEdit(t *testing.T) {
req.Method, req.URL.Path, req.Header.Get("Content-Type"),
)
}
if bytes.Compare(body, expectedInput) != 0 {
if !bytes.Equal(body, expectedInput) {
if updateInputFixtures {
// Convenience to allow recapturing the input and persisting it here
ioutil.WriteFile(inputFile, body, os.FileMode(0644))