INFRA-2175

| Saqib | Fix lint errors
This commit is contained in:
saqib-perwaiz_navi
2023-09-14 15:24:58 +05:30
parent 1a0869de64
commit eb84946974
4 changed files with 18 additions and 8 deletions

View File

@@ -26,8 +26,6 @@ const documentDbTfPath = "document-db-tf"
var manifestFiles = [2]string{"sample_infra_manifest", "sample_infra_manifest_2"}
var testActions Actions
func textDiff(text1, text2 string) string {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(text1, text2, false)
@@ -72,7 +70,7 @@ func compareResourceWithOutput(resouceDir string, resource string, manifestFileN
if err != nil {
return err
}
if bytes.Compare(expectedOutput, actualOutput) != 0 {
if !bytes.Equal(expectedOutput, actualOutput) {
return fmt.Errorf("Mismatch for %s, diff: %s\n", path, textDiff(string(actualOutput), string(expectedOutput)))
}
return nil
@@ -103,7 +101,7 @@ func TestBinData_CompareWithTemplates(t *testing.T) {
t.Error(err)
}
if bytes.Compare(actualTemplate, binDataTemplate) != 0 {
if !bytes.Equal(actualTemplate, binDataTemplate) {
t.Errorf("Found outdated bindata for %s", path)
}
return nil