Version online

This commit is contained in:
admju
2024-09-04 15:32:18 +00:00
parent 48301bf82e
commit a7a5465a22
9 changed files with 311 additions and 116 deletions

View File

@@ -32,4 +32,22 @@ func CopyFile(src string, dst string) (error) {
return errCopy
}
return nil
}
func CopyContentFile(content string, dst string) (error) {
folderPath := filepath.Dir(dst)
os.MkdirAll(folderPath, os.ModePerm)
fout, errCreate := os.Create(dst)
if errCreate != nil {
return errCreate
}
defer fout.Close()
_, errCopy := fout.WriteString(content)
if errCopy != nil {
return errCopy
}
return nil
}