{"record":{"id":"67a08c381413ae70","repo":"kataras/iris","slug":"unexpected-tag-option-s","errorCode":null,"errorMessage":"unexpected tag option: %s","messagePattern":"unexpected tag option: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"x/sqlx/struct_row.go","lineNumber":88,"sourceCode":"\t\tvar key, value string\n\n\t\tkv := strings.Split(opt, \"=\") // When more options come to play.\n\t\tswitch len(kv) {\n\t\tcase 2:\n\t\t\tkey = kv[0]\n\t\t\tvalue = kv[1]\n\t\tcase 1:\n\t\t\tc.Name = kv[0]\n\t\t\treturn nil\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"option: %s: expected key value separated by '='\", opt)\n\t\t}\n\n\t\tswitch key {\n\t\tcase \"name\":\n\t\t\tc.Name = value\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unexpected tag option: %s\", key)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":70,"sourceCodeEnd":94,"githubUrl":"https://github.com/kataras/iris/blob/7bedaf55a0b64bbb2248a5845a2c60d81a30996a/x/sqlx/struct_row.go#L70-L94","documentation":"After splitting a tag option into key=value, parseOptions only recognizes the key \"name\". Any other key is rejected with this error, keeping the tag grammar strict so typos fail fast at registration instead of being silently ignored.","triggerScenarios":"A tag such as `db:\"column=users\"` or `db:\"name=users;primary=true\"` — any option key other than `name`.","commonSituations":"Copying tag options from GORM (`gorm:\"primary_key\"`) or other libraries; guessing at supported options like `type`, `primary`, `skip`.","solutions":["Replace the unsupported key with the supported one: only `name=...` is valid","Delete the unsupported option entirely","Use `db:\"-\"` if the field should not be mapped at all"],"exampleFix":"// before\nID int `db:\"name=id;primary=true\"`\n// after\nID int `db:\"name=id\"`","handlingStrategy":"validation","validationCode":"for _, kv := range strings.Split(tag, \";\") {\n\tparts := strings.SplitN(kv, \"=\", 2)\n\tif len(parts) == 2 && parts[0] != \"name\" { return fmt.Errorf(\"unsupported db tag option %q\", parts[0]) }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the `name=` option; no other keys are supported","Don't copy GORM/xorm tag options verbatim","Grep codebase for db:\" tags during library upgrades"],"tags":["struct-tags","parsing","registration"],"backgroundTag":"unsupported-tag-option","analyzedSha":"7bedaf55a0b64bbb2248a5845a2c60d81a30996a","analyzedAt":"2026-08-30T20:38:16.250Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}