{"record":{"id":"e2d2d5e5905c5289","repo":"redis/go-redis","slug":"redis-newclient-nil-options","errorCode":null,"errorMessage":"redis: NewClient nil options","messagePattern":"redis: NewClient nil options","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"redis.go","lineNumber":2083,"sourceCode":"\t*baseClient\n\tcmdable\n\n\t// cscLifecycleOwner keeps the canonical Client wrapper (the one whose GC\n\t// cleanup owns the drainer) reachable while a WithTimeout clone can still\n\t// serve from its cache. Nil on the canonical wrapper and on non-CSC clones.\n\tcscLifecycleOwner *Client\n\n\tautopipelinerMu     *sync.Mutex    // guards the autopipeliner fields against concurrent first-call creation\n\tautopipeliner       *AutoPipeliner // blocking face (Client.AutoPipeline)\n\tasyncAutopipeliner  *AutoPipeliner // deferred face (Client.AsyncAutoPipeline)\n\tautopipelinerClosed bool           // set by Close: refuse to resurrect a pipeliner on a closed client\n}\n\n// NewClient returns a client to the Redis Server specified by Options.\n// Passing nil Options will cause a panic.\nfunc NewClient(opt *Options) *Client {\n\tif opt == nil {\n\t\tpanic(\"redis: NewClient nil options\")\n\t}\n\t// clone to not share options with the caller\n\topt = opt.clone()\n\topt.init()\n\n\t// Push notifications are always enabled for RESP3 (cannot be disabled)\n\n\tc := Client{\n\t\tbaseClient: &baseClient{\n\t\t\tapClosed: &atomic.Bool{},\n\t\t\topt:      opt,\n\t\t\tonClose:  &onCloseHooks{},\n\t\t\thimport:  newHImportRegistry(),\n\t\t},\n\t}\n\tc.init()\n\n\t// Initialize push notification processor using shared helper","sourceCodeStart":2065,"sourceCodeEnd":2101,"githubUrl":"https://github.com/redis/go-redis/blob/c5cad058c72f58370553b48566302303cf8a2e89/redis.go#L2065-L2101","documentation":"Error \"redis: NewClient nil options\" thrown in redis/go-redis.","triggerScenarios":"Thrown at redis.go:2083 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":"c5cad058c72f58370553b48566302303cf8a2e89","analyzedAt":"2026-09-01T06:50:53.388Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}