{"record":{"id":"c10198f4d3389c42","repo":"go-playground/validator","slug":"tag-s-struct-c10198","errorCode":null,"errorMessage":"tag '%s'不能用於struct類型.","messagePattern":"tag '(.+?)'不能用於struct類型\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"translations/zh_tw/zh_tw.go","lineNumber":481,"sourceCode":"\n\t\t\t\tcase reflect.Slice, reflect.Map, reflect.Array:\n\t\t\t\t\tvar c string\n\n\t\t\t\t\terr = fn()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto END\n\t\t\t\t\t}\n\n\t\t\t\t\tc, err = ut.C(\"lt-items-item\", f64, digits, ut.FmtNumber(f64, digits))\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto END\n\t\t\t\t\t}\n\n\t\t\t\t\tt, err = ut.T(\"lt-items\", fe.Field(), c)\n\n\t\t\t\tcase reflect.Struct:\n\t\t\t\t\tif fe.Type() != reflect.TypeOf(time.Time{}) {\n\t\t\t\t\t\terr = fmt.Errorf(\"tag '%s'不能用於struct類型.\", fe.Tag())\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt, err = ut.T(\"lt-datetime\", fe.Field())\n\t\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\terr = fn()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tgoto END\n\t\t\t\t\t}\n\n\t\t\t\t\tt, err = ut.T(\"lt-number\", fe.Field(), ut.FmtNumber(f64, digits))\n\t\t\t\t}\n\n\t\t\tEND:\n\t\t\t\tif err != nil {\n\t\t\t\t\tfmt.Printf(\"警告: 翻譯欄位錯誤: %s\", err)\n\t\t\t\t\treturn fe.(error).Error()\n\t\t\t\t}","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/go-playground/validator/blob/facf128d2eecf42bd4ff447adc961aa21bb64aed/translations/zh_tw/zh_tw.go#L463-L499","documentation":"Raised inside the Traditional Chinese 'lt' translation registration when the field under translation is a struct. Because lt is only meaningful for numbers, strings, slices/maps/arrays and time.Time, an arbitrary struct cannot be compared and the translator emits this error. It fires when a struct field other than time.Time carries the lt tag.","triggerScenarios":"Thrown at translations/zh_tw/zh_tw.go:481 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the lt tag from the struct field","Apply lt to the struct's comparable sub-fields","Register a struct-level validation function for custom rules","Ensure datetime fields are exactly time.Time"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"facf128d2eecf42bd4ff447adc961aa21bb64aed","analyzedAt":"2026-09-02T10:19:04.986Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}