Better VM runtime logic

This commit is contained in:
AlexSSD7 2023-09-02 11:47:58 +01:00
commit 7b5391f4d8
7 changed files with 165 additions and 220 deletions

View file

@ -27,10 +27,8 @@ func (s *Storage) download(url string, hash []byte, out string, applyReaderMiddl
_, err := os.Stat(out)
if err == nil {
return errors.Wrap(err, "file already exists")
} else {
if !errors.Is(err, os.ErrNotExist) {
return errors.Wrap(err, "stat out path")
}
} else if !errors.Is(err, os.ErrNotExist) {
return errors.Wrap(err, "stat out path")
}
f, err := os.OpenFile(out, os.O_CREATE|os.O_WRONLY, 0400)