go: bump go/packages version ci to 1.18+1.19 (#2832)

* bumped pkg golang.org/x/tools version to address issue #2826

* .github: update go1.19 in go generate

Co-authored-by: Ankit Patial <ankitpatial@gmail.com>
This commit is contained in:
Ariel Mashraki
2022-08-05 10:39:39 +03:00
committed by Ariel Mashraki
parent 89007ec983
commit 47972774c5
295 changed files with 218 additions and 1054 deletions

View File

@@ -104,7 +104,6 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
// User.
// Query().
// Count(ctx)
//
func (c *Client) Debug() *Client {
if c.debug {
return c

View File

@@ -85,7 +85,6 @@ type AggregateFunc func(*sql.Selector) string
// GroupBy(field1, field2).
// Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
// Scan(ctx, &v)
//
func As(fn AggregateFunc, end string) AggregateFunc {
return func(s *sql.Selector) string {
return sql.As(fn(s), end)

View File

@@ -121,7 +121,6 @@ func HasFields(field string, fields ...string) Condition {
// If executes the given hook under condition.
//
// hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
//
func If(hk ent.Hook, cond Condition) ent.Hook {
return func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
@@ -136,7 +135,6 @@ func If(hk ent.Hook, cond Condition) ent.Hook {
// On executes the given hook only for the given operation.
//
// hook.On(Log, ent.Delete|ent.Create)
//
func On(hk ent.Hook, op ent.Op) ent.Hook {
return If(hk, HasOp(op))
}
@@ -144,7 +142,6 @@ func On(hk ent.Hook, op ent.Op) ent.Hook {
// Unless skips the given hook only for the given operation.
//
// hook.Unless(Log, ent.Update|ent.UpdateOne)
//
func Unless(hk ent.Hook, op ent.Op) ent.Hook {
return If(hk, Not(HasOp(op)))
}
@@ -165,7 +162,6 @@ func FixedError(err error) ent.Hook {
// Reject(ent.Delete|ent.Update),
// }
// }
//
func Reject(op ent.Op) ent.Hook {
hk := FixedError(fmt.Errorf("%s operation is not allowed", op))
return On(hk, op)

View File

@@ -60,10 +60,9 @@ func Create(ctx context.Context, s *Schema, tables []*schema.Table, opts ...sche
// WriteTo writes the schema changes to w instead of running them against the database.
//
// if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil {
// if err := client.Schema.WriteTo(context.Background(), os.Stdout); err != nil {
// log.Fatal(err)
// }
//
// }
func (s *Schema) WriteTo(ctx context.Context, w io.Writer, opts ...schema.MigrateOption) error {
return Create(ctx, &Schema{drv: &schema.WriteDriver{Writer: w, Driver: s.drv}}, Tables, opts...)
}

View File

@@ -42,7 +42,6 @@ func ValidColumn(column string) bool {
// it should be imported in the main as follows:
//
// import _ "entgo.io/ent/examples/privacyadmin/ent/runtime"
//
var (
Hooks [1]ent.Hook
Policy ent.Policy

View File

@@ -266,7 +266,6 @@ func (uq *UserQuery) Clone() *UserQuery {
// GroupBy(user.FieldName).
// Aggregate(ent.Count()).
// Scan(ctx, &v)
//
func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy {
grbuild := &UserGroupBy{config: uq.config}
grbuild.fields = append([]string{field}, fields...)
@@ -293,7 +292,6 @@ func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy {
// client.User.Query().
// Select(user.FieldName).
// Scan(ctx, &v)
//
func (uq *UserQuery) Select(fields ...string) *UserSelect {
uq.fields = append(uq.fields, fields...)
selbuild := &UserSelect{UserQuery: uq}