Skip to content

Fix the judgment of the number of arrays - #125

Open
rsaLive wants to merge 1 commit into
mwitkow:masterfrom
rsaLive:bugfix/repeated_count_x
Open

Fix the judgment of the number of arrays#125
rsaLive wants to merge 1 commit into
mwitkow:masterfrom
rsaLive:bugfix/repeated_count_x

Conversation

@rsaLive

@rsaLive rsaLive commented Sep 10, 2024

Copy link
Copy Markdown

show code

message CreArtProResponse {
        string Msg   =   1  [json_name = "msg"];
        ArtworkAddRes Data   = 2  [json_name = "data"];
        repeated string Uuids = 3 [(validator.field) = {repeated_count_min: 1,human_error: "At least one department is required"}];
}
if len(this.Uuids) < 1 {
		return github_com_mwitkow_go_proto_validators.FieldError("Uuids", fmt.Errorf(`At least one department is required`))
	}
	for _, item := range this.Uuids {
	}

error

item is generated but not used

modify

If fieldName is RepeatedCountMin or RepeatedCountMax, it returns false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant