]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/files.go
Add initial validations of config.yaml
[rbdr/mobius] / hotline / files.go
index 42e25db2aaec634fc3b905b081600f8c3f3f6504..e77f63129f1a5e574b4260aff4c8649e066bafc3 100644 (file)
@@ -56,6 +56,9 @@ func getFileNameList(filePath string) (fields []Field, err error) {
                        }
 
                        rFile, err := os.Stat(filePath + "/" + resolvedPath)
+                       if errors.Is(err, os.ErrNotExist) {
+                               continue
+                       }
                        if err != nil {
                                return fields, err
                        }
@@ -180,7 +183,7 @@ func effectiveFile(filePath string) (*os.File, error) {
        }
 
        if errors.Is(err, fs.ErrNotExist) {
-               file, err = os.OpenFile(filePath+incompleteFileSuffix, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
+               file, err = os.OpenFile(filePath+incompleteFileSuffix, os.O_APPEND|os.O_WRONLY, 0644)
                if err != nil {
                        return nil, err
                }