Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
longyue0521 committed Jun 14, 2024
1 parent ca6fff7 commit 94cc43b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/merger/factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ func (q QuerySpec) Validate() error {

func (q QuerySpec) validateFeatures() error {
for i, v := range q.Features {
if i > 0 {
if v < q.Features[i-1] {
return fmt.Errorf("%w: 顺序错误", ErrInvalidFeatures)
}
if i == 0 {
continue
}
if v < q.Features[i-1] {
return fmt.Errorf("%w: 顺序错误", ErrInvalidFeatures)
}
}
if slice.Contains(q.Features, query.AggregateFunc) && slice.Contains(q.Features, query.GroupBy) {
Expand Down

0 comments on commit 94cc43b

Please sign in to comment.