Skip to content

Commit

Permalink
Fix support for repeated int64 inclusion check (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingzhen committed Jun 13, 2024
1 parent d338e0a commit 451a7c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
14 changes: 14 additions & 0 deletions templates/goshared/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ var _ interface{
{{- end }}
}
{{ end }}{{ end }}
{{ if has .Rules.Items.GetInt64 "In" }} {{ if .Rules.Items.GetInt64.In }}
var {{ lookup .Field "InLookup" }} = map[int64]struct{}{
{{- range .Rules.Items.GetInt64.In }}
{{ inKey $f . }}: {},
{{- end }}
}
{{ end }}{{ end }}
{{ if has .Rules.Items.GetInt64 "NotIn" }} {{ if .Rules.Items.GetInt64.NotIn }}
var {{ lookup .Field "NotInLookup" }} = map[int64]struct{}{
{{- range .Rules.Items.GetInt64.NotIn }}
{{ inKey $f . }}: {},
{{- end }}
}
{{ end }}{{ end }}
{{ if has .Rules.Items.GetAny "In" }} {{ if .Rules.Items.GetAny.In }}
var {{ lookup .Field "InLookup" }} = map[string]struct{}{
{{- range .Rules.Items.GetAny.In }}
Expand Down
10 changes: 5 additions & 5 deletions validate/validate.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 451a7c2

Please sign in to comment.