Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

*Query.prepareQuery static error value uses fmt.Errorf instead of errors.New #4037

Open
2 tasks done
willfaught opened this issue Apr 27, 2024 · 0 comments
Open
2 tasks done

Comments

@willfaught
Copy link
Contributor

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

Current Behavior 馃槸

Generated code in ent/cogu_query.go:

func (cgq *CoGuQuery) prepareQuery(ctx context.Context) error {
        for _, inter := range cgq.inters {
                if inter == nil {
                        return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
// ...

Expected Behavior 馃

Use errors.New for static strings. It's much faster.

Steps to Reproduce 馃暪

Steps:

  1. Generate ent/foo_query.go file.

Your Environment 馃寧

Tech Version
Go 1go version go1.22.2 darwin/arm64
Ent v0.13.1
Database PG
Driver https://github.com/lib/pq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant