{"record":{"id":"b026064dd3995313","repo":"probelabs/goreplay","slug":"value-should-be-percent-and-contain","errorCode":null,"errorMessage":"Value should be percent and contain '%'","messagePattern":"Value should be percent and contain '%'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"http_modifier_settings.go","lineNumber":118,"sourceCode":"\n\tf := hashFilter{name: []byte(valArr[0])}\n\n\tval := strings.TrimSpace(valArr[1])\n\n\tif strings.Contains(val, \"%\") {\n\t\tp, _ := strconv.ParseInt(val[:len(val)-1], 0, 0)\n\t\tf.percent = uint32(p)\n\t} else if strings.Contains(val, \"/\") {\n\t\t// DEPRECATED format\n\t\tvar num, den uint64\n\n\t\tfracArr := strings.Split(val, \"/\")\n\t\tnum, _ = strconv.ParseUint(fracArr[0], 10, 64)\n\t\tden, _ = strconv.ParseUint(fracArr[1], 10, 64)\n\n\t\tf.percent = uint32((float64(num) / float64(den)) * 100)\n\t} else {\n\t\treturn errors.New(\"Value should be percent and contain '%'\")\n\t}\n\n\t*h = append(*h, f)\n\n\treturn nil\n}\n\n// Handling of --http-set-header option\ntype httpHeader struct {\n\tName  string\n\tValue string\n}\n\n// HTTPHeaders is a slice of headers that must appended\ntype HTTPHeaders []httpHeader\n\nfunc (h *HTTPHeaders) String() string {\n\treturn fmt.Sprint(*h)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/http_modifier_settings.go#L100-L136","documentation":"Flag-value validation error raised by HTTPHashFilters.Set when the value after the colon contains neither '%' (current format) nor '/' (deprecated fraction format), so no percentage can be parsed into hashFilter.percent.","triggerScenarios":"Thrown at http_modifier_settings.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Append a percent sign: 'user_id:50%' instead of 'user_id:50'","Use the legacy fraction form '1/2' only if intentionally relying on the deprecated format","Validate the flag value in scripts before launching gor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251e45abd242886bb64ff2b2dc98789556b56330","analyzedAt":"2026-09-02T16:44:11.369Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}