16 lines
206 B
Go
16 lines
206 B
Go
|
package files
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func OpenFileForWriting(fileLocation string) (*os.File, error) {
|
||
|
err := MkdirParent(fileLocation)
|
||
|
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return os.Create(fileLocation)
|
||
|
}
|