Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 68a8d2d

Browse files
kalbasitclaude
andcommitted
fix: skip _test.go files when detecting package name
detectPackageName was picking up _test.go files (package database_test) before non-test files, causing generated files to use the wrong package declaration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 780b71d commit 68a8d2d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

generator/helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ func detectPackageName(dir string) string {
465465
if strings.HasPrefix(name, "generated_") {
466466
continue
467467
}
468+
if strings.HasSuffix(name, "_test.go") {
469+
continue
470+
}
468471
data, err := os.ReadFile(filepath.Join(dir, name))
469472
if err != nil {
470473
continue

0 commit comments

Comments
 (0)