mirror of https://github.com/databricks/cli.git
Address feedbacK
This commit is contained in:
parent
bfb13afa8e
commit
96a6cef0d6
|
@ -7,6 +7,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
|
@ -292,12 +293,10 @@ func writeInputFile(inputPath string, input dyn.Value) error {
|
||||||
|
|
||||||
// loadLocationsFile loads locations.json containing source locations for generated YAML.
|
// loadLocationsFile loads locations.json containing source locations for generated YAML.
|
||||||
func loadLocationsFile(locationsPath string) (*pythonLocations, error) {
|
func loadLocationsFile(locationsPath string) (*pythonLocations, error) {
|
||||||
if _, err := os.Stat(locationsPath); os.IsNotExist(err) {
|
|
||||||
return newPythonLocations(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
locationsFile, err := os.Open(locationsPath)
|
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)
|
return nil, fmt.Errorf("failed to open locations file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue