Skip to content

Commit

Permalink
Change string comparison to bytes.Equal
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-z committed Feb 17, 2024
1 parent 6d7c472 commit b3b9287
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/file.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package util

import (
"bytes"
"encoding/gob"
"io"
"os"
Expand Down Expand Up @@ -616,7 +617,7 @@ func CopyLockFile(sourceFolder string, destinationFolder string, logger *logrus.
return errors.WithStackTrace(destReadErr)
}

if string(sourceContents) == string(destinationContents) {
if bytes.Equal(sourceContents, destinationContents) {
logger.Debugf("Source and destination lock file contents are the same. Not copying.")
return nil
}
Expand Down

0 comments on commit b3b9287

Please sign in to comment.