{"record":{"id":"83cf56370769e890","repo":"larksuite/cli","slug":"end-position-is-before-start","errorCode":null,"errorMessage":"end position is before start","messagePattern":"end position is before start","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/lark_sheet_sheet_structure.go","lineNumber":839,"sourceCode":"\tif len(parts) > 2 {\n\t\treturn \"\", 0, 0, fmt.Errorf(\"expected \\\"start:end\\\" or single element\") //nolint:forbidigo // intermediate error; callers wrap it into a typed flag validation error\n\t}\n\tdim1, idx1, err := parseA1Position(parts[0])\n\tif err != nil {\n\t\treturn \"\", 0, 0, err\n\t}\n\tif len(parts) == 1 {\n\t\treturn dim1, idx1, idx1, nil\n\t}\n\tdim2, idx2, err := parseA1Position(parts[1])\n\tif err != nil {\n\t\treturn \"\", 0, 0, err\n\t}\n\tif dim1 != dim2 {\n\t\treturn \"\", 0, 0, fmt.Errorf(\"cannot mix row (digits) and column (letters) in one range\") //nolint:forbidigo // intermediate error; callers wrap it into a typed flag validation error\n\t}\n\tif idx2 < idx1 {\n\t\treturn \"\", 0, 0, fmt.Errorf(\"end position is before start\") //nolint:forbidigo // intermediate error; callers wrap it into a typed flag validation error\n\t}\n\treturn dim1, idx1, idx2, nil\n}\n\n// parseA1Position parses a single A1 position element: pure digits → row\n// (1-based number, returned as 0-based idx); pure letters → column (letters\n// case-insensitive, \"A\" → 0, \"AA\" → 26).\nfunc parseA1Position(s string) (dimension string, idx int, err error) {\n\ts = strings.TrimSpace(s)\n\tif s == \"\" {\n\t\treturn \"\", 0, fmt.Errorf(\"position is empty\") //nolint:forbidigo // intermediate error; callers wrap it into a typed flag validation error\n\t}\n\tisDigits := true\n\tisLetters := true\n\tfor _, r := range s {\n\t\tif r < '0' || r > '9' {\n\t\t\tisDigits = false\n\t\t}","sourceCodeStart":821,"sourceCodeEnd":857,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/lark_sheet_sheet_structure.go#L821-L857","documentation":"Guard in parseA1Range: the parsed end index is smaller than the start index; A1 ranges must be given in start-before-end order (0-based inclusive indices).","triggerScenarios":"Thrown at shortcuts/sheets/lark_sheet_sheet_structure.go:839 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the range low:high, e.g. 3:7"],"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"}