Skip to content

fix(boilingcore): stop go.mod search at filesystem root - #1485

Open
dajiaohuang wants to merge 1 commit into
aarondl:masterfrom
dajiaohuang:fix/1479-windows-missing-go-mod-loop
Open

dajiaohuang wants to merge 1 commit into
aarondl:masterfrom
dajiaohuang:fix/1479-windows-missing-go-mod-loop

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #1479.

The go.mod ancestor search stopped on / and ., but a Windows drive root is stable under filepath.Dir (for example, filepath.Dir("C:\\") == "C:\\"). When no go.mod exists, the loop therefore never terminates. Stop when the parent path equals the current path, and cover the Windows root case with a focused regression test.

Validation on Windows with Go 1.26.3:

  • go test -mod=readonly -run '^TestFindGoModPathStopsAtFilesystemRoot$' -count=1 -timeout=8s ./boilingcore — passed.
  • gofmt and git diff --check — passed.
  • go test -mod=readonly -short ./boilingcore — does not pass on this Windows host: the existing TestOutputFilenameParts panics on slash-delimited fixtures because outputFilenameParts splits using the native path separator. Those files are unchanged and the failure is unrelated to this patch.

No database or external application service was used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinite loop on Windows when go.mod is missing

1 participant