createEmptyFile creates an empty file at |fullFilepath| if a file does not exist already. If a file does exist at that path, no action is taken.
(fullFilepath string)
| 144 | // createEmptyFile creates an empty file at |fullFilepath| if a file does not exist already. If a file does exist |
| 145 | // at that path, no action is taken. |
| 146 | func createEmptyFile(fullFilepath string) (err error) { |
| 147 | _, err = os.Stat(fullFilepath) |
| 148 | if os.IsNotExist(err) { |
| 149 | var emptyFile *os.File |
| 150 | emptyFile, err = os.Create(fullFilepath) |
| 151 | defer emptyFile.Close() |
| 152 | } |
| 153 | return err |
| 154 | } |
no test coverage detected