#1479·sqlboiler

Infinite loop on Windows when go.mod is missing

Author: DeeCenCreated Sep 1, 2026Updated Sep 1, 2026

In Windows environments, when a project lacks a go.mod file, the loop in boilingcore.go (line 718) falls into an infinite loop.

On Windows, dir eventually reaches the root directory (e.g., C:), but filepath.Dir("C:\") returns "C:\" rather than "/" or ".". As a result, dir != "/" remains true indefinitely, causing the application to hang in an infinite loop.

I have been waiting for a looooooong time!

https://github.com/aarondl/sqlboiler/blob/master/boilingcore/boilingcore.go#L718

for dir != "/" && dir != "." {
    resolvedPath := filepath.Join(dir, "go.mod")

    _, err := os.Stat(resolvedPath)
    if os.IsNotExist(err) {
    	dir = filepath.Dir(dir)
    } else {
    	path = resolvedPath
    	break
    }
}