fix comparison value for file content
The comparison of the wanted and current file content was wrong.
This commit is contained in:
parent
ef72359b2d
commit
7229ba2f5c
|
@ -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…
Reference in New Issue