{"record":{"id":"cc97134529ea6c22","repo":"larksuite/cli","slug":"duplicate-attribute-q","errorCode":null,"errorMessage":"duplicate attribute %q","messagePattern":"duplicate attribute %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/doc/local_doc_resources.go","lineNumber":2348,"sourceCode":"\tdecoder := xml.NewDecoder(strings.NewReader(raw))\n\tfor {\n\t\ttoken, err := decoder.Token()\n\t\tif err != nil {\n\t\t\treturn localDocResourceTag{}, err\n\t\t}\n\t\tstart, ok := token.(xml.StartElement)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif start.Name.Local != expected {\n\t\t\treturn localDocResourceTag{}, fmt.Errorf(\"expected <%s>, got <%s>\", expected, start.Name.Local) //nolint:forbidigo // caller wraps with typed validation error.\n\t\t}\n\t\tattrs := make([]html5BlockAttr, 0, len(start.Attr))\n\t\tseenAttrs := make(map[string]struct{}, len(start.Attr))\n\t\tfor _, attr := range start.Attr {\n\t\t\tattrName := strings.ToLower(strings.TrimSpace(attr.Name.Local))\n\t\t\tif _, exists := seenAttrs[attrName]; exists {\n\t\t\t\treturn localDocResourceTag{}, fmt.Errorf(\"duplicate attribute %q\", attrName) //nolint:forbidigo // caller wraps with typed validation error.\n\t\t\t}\n\t\t\tseenAttrs[attrName] = struct{}{}\n\t\t\tattrs = append(attrs, html5BlockAttr{Name: attr.Name.Local, Value: attr.Value})\n\t\t}\n\t\treturn localDocResourceTag{Name: expected, Attrs: attrs, SelfClosing: strings.HasSuffix(strings.TrimSpace(raw), \"/>\")}, nil\n\t}\n}\n\nfunc escapeBareXMLAmpersandsInTagAttr(raw, targetAttr string) string {\n\tfor i := 1; i < len(raw); {\n\t\tfor i < len(raw) && isXMLSpace(raw[i]) {\n\t\t\ti++\n\t\t}\n\t\tnameStart := i\n\t\tfor i < len(raw) && isLocalDocResourceAttrNameByte(raw[i]) {\n\t\t\ti++\n\t\t}\n\t\tif nameStart == i {","sourceCodeStart":2330,"sourceCodeEnd":2366,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/doc/local_doc_resources.go#L2330-L2366","documentation":"Guard in the HTML-block tag parser: an XML start element declares the same attribute name twice (after lowercasing), which cannot be represented in the attribute map. Wraps into a typed validation error by the caller.","triggerScenarios":"Thrown at shortcuts/doc/local_doc_resources.go:2348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicated attribute from the tag"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}