Address feedbacK

This commit is contained in:
Gleb Kanterov 2024-10-08 10:28:51 +02:00
parent bfb13afa8e
commit 96a6cef0d6
No known key found for this signature in database
GPG Key ID: 4D87C640DBD00176
1 changed files with 4 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
@ -292,12 +293,10 @@ func writeInputFile(inputPath string, input dyn.Value) error {
// loadLocationsFile loads locations.json containing source locations for generated YAML.
func loadLocationsFile(locationsPath string) (*pythonLocations, error) {
if _, err := os.Stat(locationsPath); os.IsNotExist(err) {
return newPythonLocations(), nil
}
locationsFile, err := os.Open(locationsPath)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
return newPythonLocations(), nil
} else if err != nil {
return nil, fmt.Errorf("failed to open locations file: %w", err)
}