ent icon indicating copy to clipboard operation
ent copied to clipboard

Duplicate Method Error for "value" Field Name in Generated Ent Files

Open akr99799 opened this issue 2 years ago • 1 comments

Description:

When utilizing Ent ORM and defining a field named "value" within my schema, an issue arises where the generated Ent files produce a duplicate method error. Specifically, the GetValue method is being generated in two separate files, resulting in a conflict.

  • [ ] The issue is present in the latest release.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

The GetValue method is duplicated across separate files within the generated Ent codebase, leading to a conflict.

Expected Behavior 🤔

The Ent code generation process should not result in duplicate method creation, especially when defining a field named "value."

Steps to Reproduce 🕹

Steps:

  1. Define an Ent schema with a field named "value".
  2. Generate Ent files using the defined schema.
  3. Review the generated code to observe the duplicate GetValue method across different files.

Your Environment 🌎

Tech Version
Go 1.21.1
Ent 0.12.3
Database Postgresql
Driver https://pkg.go.dev/database/sql/driver

akr99799 avatar Nov 23 '23 04:11 akr99799

Which files is the GetValue method generated in?

henrywoody avatar May 13 '24 10:05 henrywoody