Browse Source

fix comparison value for file content

The comparison of the wanted and current file content was wrong.
master
Gibheer 2 years ago
parent
commit
7229ba2f5c
  1. 5
      file/main.go

5
file/main.go

@ -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
}

Loading…
Cancel
Save