{"id":"3686783c73881b03","repo":"go-redis/redis","slug":"redis-moduleloadex-nil-config","errorCode":null,"errorMessage":"redis: ModuleLoadex nil config","messagePattern":"redis: ModuleLoadex nil config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands.go","lineNumber":895,"sourceCode":"func (c *ModuleLoadexConfig) toArgs() []interface{} {\n\targs := make([]interface{}, 3, 3+len(c.Conf)*3+len(c.Args)*2)\n\targs[0] = \"MODULE\"\n\targs[1] = \"LOADEX\"\n\targs[2] = c.Path\n\tfor k, v := range c.Conf {\n\t\targs = append(args, \"CONFIG\", k, v)\n\t}\n\tfor _, arg := range c.Args {\n\t\targs = append(args, \"ARGS\", arg)\n\t}\n\treturn args\n}\n\n// ModuleLoadex Redis `MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] [ARGS args [args ...]]` command.\nfunc (c cmdable) ModuleLoadex(ctx context.Context, conf *ModuleLoadexConfig) *StringCmd {\n\tif conf == nil {\n\t\tcmd := NewStringCmd(ctx)\n\t\tcmd.SetErr(errors.New(\"redis: ModuleLoadex nil config\"))\n\t\treturn cmd\n\t}\n\tcmd := NewStringCmd(ctx, conf.toArgs()...)\n\t_ = c(ctx, cmd)\n\treturn cmd\n}\n\n/*\nMonitor - represents a Redis MONITOR command, allowing the user to capture\nand process all commands sent to a Redis server. This mimics the behavior of\nMONITOR in the redis-cli.\n\nNotes:\n- Using MONITOR blocks the connection to the server for itself. It needs a dedicated connection\n- The user should create a channel of type string\n- This runs concurrently in the background. Trigger via the Start and Stop functions\nSee further: Redis MONITOR command: https://redis.io/commands/monitor\n*/","sourceCodeStart":877,"sourceCodeEnd":913,"githubUrl":"https://github.com/go-redis/redis/blob/36d97525cd8076aed67cddf54778e9ea84550929/commands.go#L877-L913","documentation":"Error \"redis: ModuleLoadex nil config\" thrown in go-redis/redis.","triggerScenarios":"Thrown at commands.go:895 when the library encounters an invalid state.","commonSituations":"Nil-check optional config pointers at the API boundary and return an early error.","solutions":["Pass a non-nil ModuleLoadexConfig to ModuleLoadex","Construct the config struct (even if fields are defaults) before calling"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"36d97525cd8076aed67cddf54778e9ea84550929","analyzedAt":"2026-08-06T01:08:27.376Z","schemaVersion":2}