{"record":{"id":"32a2696f0cc3a955","repo":"goharbor/harbor","slug":"range-must-start-with-end-with-and-contai","errorCode":null,"errorMessage":"range must start with \"[\", end with \"]\" and contains only one \"~\"","messagePattern":"range must start with \"\\[\", end with \"\\]\" and contains only one \"~\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/q/builder.go","lineNumber":132,"sourceCode":"\tdefault:\n\t\t// others: exact match\n\t\treturn escapeValue(value), nil\n\t}\n}\n\nfunc parseFuzzyMatchValue(value string) (*FuzzyMatchValue, error) {\n\tif len(value) < 2 || value[0] != '~' {\n\t\treturn nil, fmt.Errorf(`fuzzy match value must start with \"~\" and contain at least 1 other characters`)\n\t}\n\treturn &FuzzyMatchValue{\n\t\tValue: value[1:],\n\t}, nil\n}\n\nfunc parseRange(value string) (*Range, error) {\n\tlength := len(value)\n\tif value[length-1] != ']' || strings.Count(value, \"~\") != 1 {\n\t\treturn nil, fmt.Errorf(`range must start with \"[\", end with \"]\" and contains only one \"~\"`)\n\t}\n\tstrs := strings.SplitN(value[1:length-1], \"~\", 2)\n\tminVal := strings.TrimSpace(strs[0])\n\tmaxVal := strings.TrimSpace(strs[1])\n\tif len(minVal) == 0 && len(maxVal) == 0 {\n\t\treturn nil, fmt.Errorf(`min and max at least one should be set in range'`)\n\t}\n\tr := &Range{}\n\tif len(minVal) > 0 {\n\t\tr.Min = parseValue(minVal)\n\t}\n\tif len(maxVal) > 0 {\n\t\tr.Max = parseValue(maxVal)\n\t}\n\treturn r, nil\n}\n\nfunc parseOrList(value string) (*OrList, error) {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/lib/q/builder.go#L114-L150","documentation":"Error \"range must start with \"[\", end with \"]\" and contains only one \"~\"\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/lib/q/builder.go:132 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"}