{"record":{"id":"1d3aba64ec5e791c","repo":"goharbor/harbor","slug":"s-is-less-than-zero-1d3aba","errorCode":null,"errorMessage":"%s is less than zero","messagePattern":"(.+?) is less than zero","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/retention/policy/rule/latestps/evaluator.go","lineNumber":85,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tlog.Warningf(\"default parameter %d used for rule %s\", DefaultK, TemplateID)\n\n\treturn &evaluator{\n\t\tk: DefaultK,\n\t}\n}\n\n// Valid ...\nfunc Valid(params rule.Parameters) error {\n\tif params != nil {\n\t\tif p, ok := params[ParameterK]; ok {\n\t\t\tif v, ok := utils.ParseJSONInt(p); ok {\n\t\t\t\tif v < 0 {\n\t\t\t\t\treturn fmt.Errorf(\"%s is less than zero\", ParameterK)\n\t\t\t\t}\n\t\t\t\tif v >= math.MaxInt16 {\n\t\t\t\t\treturn fmt.Errorf(\"%s is too large\", ParameterK)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"%s type error\", ParameterK)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n","sourceCodeStart":67,"sourceCodeEnd":97,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/retention/policy/rule/latestps/evaluator.go#L67-L97","documentation":"Error \"%s is less than zero\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/retention/policy/rule/latestps/evaluator.go:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}