Closed safaci2000 closed 4 months ago
You can customize the generator, and replace :
character with a character of your choosing.
https://github.com/go-jet/jet/wiki/Generator#generator-customization
You can customize the generator, and replace
:
character with a character of your choosing. https://github.com/go-jet/jet/wiki/Generator#generator-customization
I'm assuming that the only way to do this, is if you invoke the Generator from code?
I've made a quick fix for this bug on bug290
branch. Special characters are removed from go identifiers.
Sounds good, thank you!
I've changed my mind on this one. There were couple of bugs opened before for similar invalid character issues. To prevent any additional bugs from opening, I've made a change on master that does not remove but replaces all invalid ascii characters with the description.
So in your case, it would be S3ColonInit
for S3:Init
enum value.
That seems like a perfectly reasonable change. Thanks for the update.
Fixed in Release v2.11.0.
Describe the bug Code generation fails for Postgres Enums.
jet -dsn="postgresql://ht_controller_user:secret@localhost:5432/funcap_controller?sslmode=disable" -schema=tasks -path=./.gen Connecting to postgres database... Retrieving schema information... FOUND 2 table(s), 0 view(s), 2 enum(s) Destination directory: .gen/funcap_controller/tasks Cleaning up destination directory... Generating table model files... Generating enum model files... Error trace:
Environment (please complete the following information):
Code snippet
Generated Code:
Obviously this fails as it's invalid Go syntax.
Expected behavior The code to actually generate without errors.