Initial commit

This commit is contained in:
user
2026-07-12 13:47:34 +04:00
commit 51e2e789d0
37 changed files with 2005 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package file
import (
"go_project/pkg/behaivor"
"os"
)
// Verification of the existence of a program with an emergency termination in case of an error
func MustIsNotExist(filename string) (result bool) {
_, err := os.Stat(filename)
if err != nil {
result = os.IsNotExist(err)
} else {
return false
}
if result == false {
behaivor.Anxiety("Error checking the existence of the file", err)
}
return true
}
// Create a file with truncated data
func MustCreate(filename string) {
file, err := os.Create(filename)
behaivor.Anxiety("File creating error", err)
file.Close()
}