1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-26 13:49:14 +08:00

base: try to correct 'no such file or directory' error

This commit is contained in:
Richard Townsend 2018-01-28 16:36:21 +00:00
parent 58ae6f4d1b
commit a3dab5ec13

View File

@ -383,7 +383,7 @@ func (c *ClassifierSerializer) WriteMetadataAtPrefix(prefix string, metadata Cla
func CreateSerializedClassifierStub(filePath string, metadata ClassifierMetadataV1) (*ClassifierSerializer, error) {
// Open the filePath
f, err := os.OpenFile(filePath, os.O_RDWR|os.O_TRUNC, 0600)
f, err := os.OpenFile(filePath, os.O_RDWR|os.O_TRUNC|os.O_CREAT, 0600)
if err != nil {
return nil, err
}