Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no translation tag(validate:"unique") #39

Open
atopx opened this issue Aug 11, 2021 · 0 comments
Open

no translation tag(validate:"unique") #39

atopx opened this issue Aug 11, 2021 · 0 comments

Comments

@atopx
Copy link

atopx commented Aug 11, 2021

definition

import (
    "github.com/go-playground/locales/zh_Hans_CN"
    "github.com/go-playground/validator/v10/translations/zh"
)

// ...

rans, _ = ut.New(zh_Hans_CN.New()).GetTranslator("zh")

type Test struct {
    Urls     []string `json:"urls" validate:"unique" label:"urls"`
}

output

Key: 'Test.urls' Error:Field validation for 'urls' failed on the 'unique' tag
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

No branches or pull requests

1 participant