Zeros function improved (do we need this?)
This commit is contained in:
parent
2f2090929c
commit
bd9f68282c
6
main.go
6
main.go
@ -86,12 +86,8 @@ func Zeros(path string, size int64) error {
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
offset, err := file.Seek(0, 0)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
buff := make([]byte, size)
|
buff := make([]byte, size)
|
||||||
file.WriteAt(buff, offset)
|
file.WriteAt(buff, 0)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user