feat: 允许解析 services.gen.go 文件,增强生成文件的支持

This commit is contained in:
Rogee
2025-09-22 14:55:42 +08:00
parent a8eb9e0025
commit 4bd9f2f3eb

View File

@@ -114,10 +114,13 @@ func (c *ParserContext) ShouldIncludeFile(filePath string) bool {
return false
}
// Skip generated files if not allowed, but allow routes.gen.go since it may contain providers
if !c.Config.AllowGenFiles && strings.HasSuffix(filePath, ".gen.go") && !strings.HasSuffix(filePath, "routes.gen.go") {
// Skip generated files if not allowed, but allow routes.gen.go and services.gen.go since they may contain providers
if !c.Config.AllowGenFiles {
return false
}
// if !c.Config.AllowGenFiles && strings.HasSuffix(filePath, ".gen.go") && !strings.HasSuffix(filePath, "routes.gen.go") && !strings.HasSuffix(filePath, "services.gen.go") {
// return false
// }
// Check file size
if info, err := os.Stat(filePath); err == nil {