{"record":{"id":"f881638d3615bd48","repo":"larksuite/cli","slug":"empty-value","errorCode":null,"errorMessage":"empty value","messagePattern":"empty value","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shortcuts/drive/drive_search.go","lineNumber":615,"sourceCode":"func floorHour(unix int64) int64 {\n\treturn unix - (unix % 3600)\n}\n\nfunc ceilHour(unix int64) int64 {\n\tif unix%3600 == 0 {\n\t\treturn unix\n\t}\n\treturn floorHour(unix) + 3600\n}\n\nvar driveSearchRelativeRe = regexp.MustCompile(`^(\\d+)([dmy])$`)\n\n// parseTimeValue accepts relative (7d, 1m=30d, 1y=365d), absolute dates in a\n// few common layouts, RFC3339, and raw unix seconds.\nfunc parseTimeValue(input string, now time.Time) (int64, error) {\n\ts := strings.TrimSpace(input)\n\tif s == \"\" {\n\t\treturn 0, fmt.Errorf(\"empty value\") //nolint:forbidigo // intermediate parse helper; caller wraps into typed ValidationError\n\t}\n\n\tif m := driveSearchRelativeRe.FindStringSubmatch(s); m != nil {\n\t\tn, _ := strconv.Atoi(m[1])\n\t\tvar days int\n\t\tswitch m[2] {\n\t\tcase \"d\":\n\t\t\tdays = n\n\t\tcase \"m\":\n\t\t\tdays = n * 30\n\t\tcase \"y\":\n\t\t\tdays = n * 365\n\t\t}\n\t\treturn now.Add(-time.Duration(days) * 24 * time.Hour).Unix(), nil\n\t}\n\n\tlayouts := []string{\n\t\ttime.RFC3339,","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/shortcuts/drive/drive_search.go#L597-L633","documentation":"Guard in parseTimeValue: the time-value input is empty or whitespace-only. Caller wraps this intermediate error into a typed flag validation error.","triggerScenarios":"Thrown at shortcuts/drive/drive_search.go:615 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a relative (7d), date, RFC3339, or unix-seconds value"],"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"}