Skip to content

Commit

Permalink
fix: stop loading the same project multiple times
Browse files Browse the repository at this point in the history
Why
===
* #294

What changed
===
* Make a copy of the FileNames and loop over that instead, so when
loadExtendProject adds to the FileNames, it doesn't try to load it
again

Test plan
===
* The repro in issue 294 now passes
  • Loading branch information
ryantm authored and F1bonacc1 committed Jan 8, 2025
1 parent 6a1799e commit 9d9e730
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ func Load(opts *LoaderOptions) (*types.Project, error) {
return nil, err
}

for idx, file := range opts.FileNames {
fileNames := make([]string, len(opts.FileNames))
_ = copy(fileNames, opts.FileNames)

for idx, file := range fileNames {
prj, err := loadProjectFromFile(file, opts)
if err != nil {
return nil, err
Expand Down

0 comments on commit 9d9e730

Please sign in to comment.