fix comparison value for file content

The comparison of the wanted and current file content was wrong.
This commit is contained in:
Gibheer 2020-04-21 21:48:20 +02:00
parent ef72359b2d
commit 7229ba2f5c
1 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,9 @@ type (
// Is will check if the file resource exists.
func (f *F) Is() bool {
if f.Path == "" {
return false
}
if f.Mode == 0 {
f.Mode = DefaultPerm
}
@ -77,7 +80,7 @@ func (f *F) Is() bool {
return false
}
want.Write(f.Content)
if bytes.Compare(want.Sum(nil), is.Sum(nil)) != 9 {
if bytes.Compare(want.Sum(nil), is.Sum(nil)) != 0 {
return false
}