Skip to content

Commit

Permalink
context with dataset fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
raoptimus committed Mar 28, 2024
1 parent 314ef29 commit 19e74ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ func ValidateValue(ctx context.Context, value any, rules ...Rule) error {
return nil
}

dataSet, err := normalizeDataSet(value)
if err != nil {
return err
}

if extDS, ok := ExtractDataSet[DataSet](ctx); !ok || value != extDS {
ctx = withDataSet(ctx, extDS)
} else {
dataSet, err := normalizeDataSet(value)
if err != nil {
return err
}
ctx = withDataSet(ctx, dataSet)
}

Expand Down

0 comments on commit 19e74ae

Please sign in to comment.