Skip to content

Commit

Permalink
Rename from validateVersion to validateVersion03
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkushinDaniil committed Feb 25, 2025
1 parent 4cbf2cc commit 37dbd51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func validateResourceBounds(fl validator.FieldLevel) bool {
}

// Custom validation function for version
func validateVersion(fl validator.FieldLevel) bool {
func validateVersion03(fl validator.FieldLevel) bool {
version, ok := fl.Field().Interface().(string)
return ok && (version == "0x3" || version == "0x100000000000000000000000000000003")
}
Expand All @@ -36,7 +36,7 @@ func Validator() *validator.Validate {
panic("failed to register validation: " + err.Error())
}

if err := v.RegisterValidation("version_0x3", validateVersion); err != nil {
if err := v.RegisterValidation("version_0x3", validateVersion03); err != nil {
panic("failed to register validation: " + err.Error())

Check warning on line 40 in validator/validator.go

View check run for this annotation

Codecov / codecov/patch

validator/validator.go#L40

Added line #L40 was not covered by tests
}

Expand Down

0 comments on commit 37dbd51

Please sign in to comment.