entc/gen: fix gen for type abbreviating to id (#750)

* cmd/ent: fix gen for type abbreviating to id

* Adding genc output changes to tests, examples
This commit is contained in:
Kevin Pierce
2020-09-11 23:47:39 -07:00
committed by GitHub
parent 4cb544c8d0
commit 46df885752
25 changed files with 138 additions and 138 deletions

View File

@@ -204,11 +204,11 @@ func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error) {
// GetX is like Get, but panics if an error occurs.
func (c *GroupClient) GetX(ctx context.Context, id int) *Group {
gr, err := c.Get(ctx, id)
obj, err := c.Get(ctx, id)
if err != nil {
panic(err)
}
return gr
return obj
}
// QueryUsers queries the users edge of a Group.
@@ -308,11 +308,11 @@ func (c *UserClient) Get(ctx context.Context, id int) (*User, error) {
// GetX is like Get, but panics if an error occurs.
func (c *UserClient) GetX(ctx context.Context, id int) *User {
u, err := c.Get(ctx, id)
obj, err := c.Get(ctx, id)
if err != nil {
panic(err)
}
return u
return obj
}
// QueryGroups queries the groups edge of a User.