MCPcopy Index your code
hub / github.com/apache/answer / init

Function init

internal/base/validator/validator.go:101–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99var GlobalValidatorMapping = make(map[i18n.Language]*MyValidator, 0)
100
101func init() {
102 for _, t := range allLanguageTranslators {
103 tran, val := getTran(t.Lo), createDefaultValidator(t.La)
104 if t.RegisterFunc != nil {
105 if err := t.RegisterFunc(val, tran); err != nil {
106 panic(err)
107 }
108 }
109 GlobalValidatorMapping[t.La] = &MyValidator{Validate: val, Tran: tran, Lang: t.La}
110 }
111}
112
113func getTran(lo locales.Translator) ut.Translator {
114 tran, ok := ut.New(lo, lo).GetTranslator(lo.Locale())

Callers

nothing calls this directly

Calls 2

getTranFunction · 0.85
createDefaultValidatorFunction · 0.85

Tested by

no test coverage detected