{"record":{"id":"816d1af133b6ced5","repo":"lionsoul2014/ip2region","slug":"searchers-d-0-expected","errorCode":null,"errorMessage":"searchers=%d, > 0 expected","messagePattern":"searchers=(.+?), > 0 expected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"binding/golang/service/config.go","lineNumber":65,"sourceCode":"\n\t// buffers\n\tvIndex  []byte\n\tcBuffer []byte\n\n\tsearchers int\n}\n\nfunc NewV4Config(cachePolicy int, xdbPath string, searchers int) (*Config, error) {\n\treturn newConfig(cachePolicy, xdb.IPv4, xdbPath, searchers)\n}\n\nfunc NewV6Config(cachePolicy int, xdbPath string, searchers int) (*Config, error) {\n\treturn newConfig(cachePolicy, xdb.IPv6, xdbPath, searchers)\n}\n\nfunc newConfig(cachePolicy int, ipVersion *xdb.Version, xdbPath string, searchers int) (*Config, error) {\n\tif searchers < 1 {\n\t\treturn nil, fmt.Errorf(\"searchers=%d, > 0 expected\", searchers)\n\t}\n\n\t// open the xdb binary file\n\thandle, err := os.OpenFile(xdbPath, os.O_RDONLY, 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer handle.Close()\n\n\t// 1, verify the xdb\n\terr = xdb.Verify(handle)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 2, load the header\n\theader, err := xdb.LoadHeader(handle)\n\tif err != nil {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/lionsoul2014/ip2region/blob/c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1/binding/golang/service/config.go#L47-L83","documentation":"Go service config guard: newConfig rejects a searchers count < 1 because at least one underlying xdb.Searcher must be created for the pool; a zero/negative pool size is meaningless.","triggerScenarios":"Thrown at binding/golang/service/config.go:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a searchers value >= 1 (e.g. 20 as used by the defaults)","Validate pool size in your configuration before building the service","Use NewIp2RegionWithPath which applies sane defaults"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c1a1fc7d5941760db3f8431dc05c48cf7f0e30a1","analyzedAt":"2026-09-02T16:58:39.988Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}