fix goreleaser

This commit is contained in:
Simon Ding
2025-09-01 01:46:58 +08:00
parent ea41fb2e95
commit a331a5b41f
14 changed files with 124 additions and 106 deletions

View File

@@ -9,6 +9,7 @@ import (
"polaris/ent/predicate"
"polaris/ent/settings"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -60,7 +61,7 @@ func (sq *SettingsQuery) Order(o ...settings.OrderOption) *SettingsQuery {
// First returns the first Settings entity from the query.
// Returns a *NotFoundError when no Settings was found.
func (sq *SettingsQuery) First(ctx context.Context) (*Settings, error) {
nodes, err := sq.Limit(1).All(setContextOp(ctx, sq.ctx, "First"))
nodes, err := sq.Limit(1).All(setContextOp(ctx, sq.ctx, ent.OpQueryFirst))
if err != nil {
return nil, err
}
@@ -83,7 +84,7 @@ func (sq *SettingsQuery) FirstX(ctx context.Context) *Settings {
// Returns a *NotFoundError when no Settings ID was found.
func (sq *SettingsQuery) FirstID(ctx context.Context) (id int, err error) {
var ids []int
if ids, err = sq.Limit(1).IDs(setContextOp(ctx, sq.ctx, "FirstID")); err != nil {
if ids, err = sq.Limit(1).IDs(setContextOp(ctx, sq.ctx, ent.OpQueryFirstID)); err != nil {
return
}
if len(ids) == 0 {
@@ -106,7 +107,7 @@ func (sq *SettingsQuery) FirstIDX(ctx context.Context) int {
// Returns a *NotSingularError when more than one Settings entity is found.
// Returns a *NotFoundError when no Settings entities are found.
func (sq *SettingsQuery) Only(ctx context.Context) (*Settings, error) {
nodes, err := sq.Limit(2).All(setContextOp(ctx, sq.ctx, "Only"))
nodes, err := sq.Limit(2).All(setContextOp(ctx, sq.ctx, ent.OpQueryOnly))
if err != nil {
return nil, err
}
@@ -134,7 +135,7 @@ func (sq *SettingsQuery) OnlyX(ctx context.Context) *Settings {
// Returns a *NotFoundError when no entities are found.
func (sq *SettingsQuery) OnlyID(ctx context.Context) (id int, err error) {
var ids []int
if ids, err = sq.Limit(2).IDs(setContextOp(ctx, sq.ctx, "OnlyID")); err != nil {
if ids, err = sq.Limit(2).IDs(setContextOp(ctx, sq.ctx, ent.OpQueryOnlyID)); err != nil {
return
}
switch len(ids) {
@@ -159,7 +160,7 @@ func (sq *SettingsQuery) OnlyIDX(ctx context.Context) int {
// All executes the query and returns a list of SettingsSlice.
func (sq *SettingsQuery) All(ctx context.Context) ([]*Settings, error) {
ctx = setContextOp(ctx, sq.ctx, "All")
ctx = setContextOp(ctx, sq.ctx, ent.OpQueryAll)
if err := sq.prepareQuery(ctx); err != nil {
return nil, err
}
@@ -181,7 +182,7 @@ func (sq *SettingsQuery) IDs(ctx context.Context) (ids []int, err error) {
if sq.ctx.Unique == nil && sq.path != nil {
sq.Unique(true)
}
ctx = setContextOp(ctx, sq.ctx, "IDs")
ctx = setContextOp(ctx, sq.ctx, ent.OpQueryIDs)
if err = sq.Select(settings.FieldID).Scan(ctx, &ids); err != nil {
return nil, err
}
@@ -199,7 +200,7 @@ func (sq *SettingsQuery) IDsX(ctx context.Context) []int {
// Count returns the count of the given query.
func (sq *SettingsQuery) Count(ctx context.Context) (int, error) {
ctx = setContextOp(ctx, sq.ctx, "Count")
ctx = setContextOp(ctx, sq.ctx, ent.OpQueryCount)
if err := sq.prepareQuery(ctx); err != nil {
return 0, err
}
@@ -217,7 +218,7 @@ func (sq *SettingsQuery) CountX(ctx context.Context) int {
// Exist returns true if the query has elements in the graph.
func (sq *SettingsQuery) Exist(ctx context.Context) (bool, error) {
ctx = setContextOp(ctx, sq.ctx, "Exist")
ctx = setContextOp(ctx, sq.ctx, ent.OpQueryExist)
switch _, err := sq.FirstID(ctx); {
case IsNotFound(err):
return false, nil
@@ -449,7 +450,7 @@ func (sgb *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy {
// Scan applies the selector query and scans the result into the given value.
func (sgb *SettingsGroupBy) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, sgb.build.ctx, "GroupBy")
ctx = setContextOp(ctx, sgb.build.ctx, ent.OpQueryGroupBy)
if err := sgb.build.prepareQuery(ctx); err != nil {
return err
}
@@ -497,7 +498,7 @@ func (ss *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect {
// Scan applies the selector query and scans the result into the given value.
func (ss *SettingsSelect) Scan(ctx context.Context, v any) error {
ctx = setContextOp(ctx, ss.ctx, "Select")
ctx = setContextOp(ctx, ss.ctx, ent.OpQuerySelect)
if err := ss.prepareQuery(ctx); err != nil {
return err
}