{"record":{"id":"a5b88111562c92e3","repo":"larksuite/cli","slug":"sheets-v","errorCode":null,"errorMessage":"sheets: %v","messagePattern":"sheets: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/sheets/flag_defs.go","lineNumber":59,"sourceCode":"\tFlags []flagDef `json:\"flags\"`\n}\n\n// loadFlagDefs returns the compiled flag definitions (flag_defs_gen.go).\n// The error return is always nil; it is retained so existing call sites that\n// handled a parse error keep compiling. There is no longer a runtime parse.\nfunc loadFlagDefs() (map[string]commandDef, error) {\n\treturn flagDefs, nil\n}\n\n// flagsFor builds the []common.Flag for a shortcut command directly from\n// flag-defs.json. System-kind flags are skipped (the framework injects\n// them). Panics if the command is absent or the JSON is malformed — this\n// is a build-time data contract, so a missing entry is a programming error\n// surfaced loudly at startup rather than a silent empty flag set.\nfunc flagsFor(command string) []common.Flag {\n\tdefs, err := loadFlagDefs()\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"sheets: %v\", err))\n\t}\n\tspec, ok := defs[command]\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"sheets: no flag-defs.json entry for %q\", command))\n\t}\n\tout := make([]common.Flag, 0, len(spec.Flags))\n\tfor _, df := range spec.Flags {\n\t\tif df.Kind == \"system\" {\n\t\t\tcontinue\n\t\t}\n\t\tout = append(out, common.Flag{\n\t\t\tName:     df.Name,\n\t\t\tType:     df.Type,\n\t\t\tDefault:  df.Default,\n\t\t\tDesc:     df.Desc,\n\t\t\tHidden:   df.Hidden,\n\t\t\tRequired: df.Required == \"required\",\n\t\t\tEnum:     df.Enum,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/sheets/flag_defs.go#L41-L77","documentation":"Compatibility error return of loadFlagDefs: it always returns nil because flag definitions are compile-time generated (flag_defs_gen.go) and no runtime parsing exists; the error slot is retained only so legacy call sites keep compiling.","triggerScenarios":"Thrown at shortcuts/sheets/flag_defs.go:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate flag_defs_gen.go; report if the compiled-in defs are malformed"],"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"}