Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions internal/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ func readConfig(stderr io.Writer, dir, filename string) (string, *config.Config,
}

base := filepath.Base(configPath)
blob, err := os.ReadFile(configPath)
file, err := os.Open(configPath)
if err != nil {
fmt.Fprintf(stderr, "error parsing %s: file does not exist\n", base)
return "", nil, err
}
defer file.Close()

conf, err := config.ParseConfig(bytes.NewReader(blob))
conf, err := config.ParseConfig(file)
if err != nil {
switch err {
case config.ErrMissingVersion:
Expand Down