-
-
Notifications
You must be signed in to change notification settings - Fork 8
Fix code generation to support pointer embedding of gorm.Model and include base fields #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
d19bb8b
920459e
a05330a
488a768
8c24a60
590632f
ae1324f
30c6e4f
09eff32
698ac24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,145 @@ | ||
| # Binaries for programs and plugins | ||
| *.exe | ||
| *.exe~ | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
|
|
||
| # Test binary, built with `go test -c` | ||
| *.test | ||
|
|
||
| # Output of the go coverage tool, specifically when used with LiteIDE | ||
| *.out | ||
|
|
||
| # Dependency directories (remove the comment below to include it) | ||
| # vendor/ | ||
|
|
||
| # Go workspace file | ||
| go.work | ||
|
|
||
| # Build output | ||
| g | ||
| gorm | ||
| /bin/ | ||
| /build/ | ||
| /dist/ | ||
|
|
||
| # IDE and Editor files | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Log files | ||
| *.log | ||
|
|
||
| # Runtime data | ||
| pids | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Coverage directory used by tools like istanbul | ||
| coverage/ | ||
|
|
||
| # nyc test coverage | ||
| .nyc_output | ||
|
|
||
| # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
| .grunt | ||
|
|
||
| # Bower dependency directory (https://bower.io/) | ||
| bower_components | ||
|
|
||
| # node_modules (if using Node.js tools) | ||
| node_modules/ | ||
|
|
||
| # Temporary folders | ||
| tmp/ | ||
| temp/ | ||
|
|
||
| # Go module download cache | ||
| $GOPATH/pkg/mod/ | ||
|
|
||
| # Go build cache | ||
| $GOCACHE/ | ||
|
|
||
| # Air live reload | ||
| tmp/ | ||
|
|
||
| # Local environment variables | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Database files | ||
| *.db | ||
| *.sqlite | ||
| *.sqlite3 | ||
|
|
||
| # Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
| *.o | ||
| *.a | ||
|
|
||
| # Folders | ||
| _obj | ||
| _test | ||
|
|
||
| # Architecture specific extensions/prefixes | ||
| *.[568vq] | ||
| [568vq].out | ||
|
|
||
| # cgo generated files | ||
| _cgo_gotypes.go | ||
| _cgo_export.* | ||
|
|
||
| # test generated files | ||
| *_test_gen.go | ||
|
|
||
| # Ignore generated documentation | ||
| *.html | ||
|
|
||
| # Ignore backup files | ||
| *.bak | ||
| *.backup | ||
| *.orig | ||
|
|
||
| # Ignore profiling files | ||
| *.prof | ||
| cpu.out | ||
| mem.out | ||
| profile.out | ||
|
|
||
| # Ignore security sensitive files | ||
| *.pem | ||
| *.key | ||
| *.crt | ||
| *.p12 | ||
|
|
||
| # Docker files (if not needed in repo) | ||
| # Dockerfile | ||
| # docker-compose.yml | ||
| # .dockerignore | ||
|
|
||
| # Kubernetes files (if not needed in repo) | ||
| # *.yaml | ||
| # *.yml | ||
|
|
||
| # Generated code (if applicable) | ||
| # *_gen.go | ||
| # *.pb.go | ||
|
|
||
| # Config files with sensitive data | ||
| config.json | ||
| secrets.yaml | ||
| secrets.yml | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,7 @@ type ( | |||||
| applicableConfigs []*genconfig.Config | ||||||
| inputPath string | ||||||
| relPath string | ||||||
| goModDir string // 缓存的 go mod 目录路径 | ||||||
|
||||||
| goModDir string // 缓存的 go mod 目录路径 | |
| goModDir string // Cached go mod directory path |
Outdated
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment contains Chinese characters. Please use English for consistency: // Initialize and cache go mod directory
| goModDir: findGoModDir(inputFile), // 初始化时缓存 go mod 目录 | |
| goModDir: findGoModDir(inputFile), // Initialize and cache go mod directory |
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addEmbeddedFields helper function always returns true, making the return value meaningless. Consider either removing the return value or implementing proper error handling that could return false in failure cases.
Copilot
AI
Sep 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error from loadNamedStructType is silently ignored. Consider logging the error or propagating it to help with debugging when struct loading fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[NitPick]
Duplicate
tmp/entry on lines 68 and 78. The Air live reload entry is redundant since temporary folders are already ignored above.Context for Agents