Skip to content

Add float32 and float64 field comparison tags - #105

Merged
leocavalcante merged 1 commit into
mainfrom
feat/float-field-operations
Sep 29, 2026
Merged

leocavalcante merged 1 commit into
mainfrom
feat/float-field-operations

Conversation

@leocavalcante

Copy link
Copy Markdown
Member

Fixes #79

Summary

  • Accept eqfield, neqfield, gtefield, gtfield, ltefield, and ltfield on float32 and float64.
  • Generate Go ==, !=, >=, >, <=, and < checks. Same operators as integer field tags, and the same comparisons go-playground/validator v10.28.0 makes with field.Float(). No epsilon.
  • Keep rejecting mixed types (float32 vs float64, float vs int) and slice or map float field comparisons.

Test plan

  • go test ./internal/analyzer/... ./internal/codegenerator/ ./types/...
  • make endtoendtests, including float32 and float64 inner and nested fields: unequal values, equal values, and ordering
  • Reviewer: confirm generated checks use direct Go operators with no epsilon

@leocavalcante leocavalcante added enhancement New feature or request go Pull requests that update go code labels Sep 29, 2026
@leocavalcante leocavalcante self-assigned this Sep 29, 2026
@leocavalcante
leocavalcante merged commit efc2c5d into main Sep 29, 2026
4 checks passed
@leocavalcante
leocavalcante deleted the feat/float-field-operations branch September 29, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement support for fields operations with float types

1 participant