{"record":{"id":"ab81d3cab468a3f8","repo":"beego/beego","slug":"beego-non-pointer-passed-to-bind-key","errorCode":null,"errorMessage":"beego: non-pointer passed to Bind: ${key}","messagePattern":"beego: non-pointer passed to Bind: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/web/context/input.go","lineNumber":446,"sourceCode":"\t\t}\n\t} else if err := input.Context.Request.ParseForm(); err != nil {\n\t\treturn errors.New(\"Error parsing request body:\" + err.Error())\n\t}\n\treturn nil\n}\n\n// Bind data from request.Form[key] to dest\n// like /?id=123&isok=true&ft=1.2&ol[0]=1&ol[1]=2&ul[]=str&ul[]=array&user.Name=astaxie\n// var id int  beegoInput.Bind(&id, \"id\")  id ==123\n// var isok bool  beegoInput.Bind(&isok, \"isok\")  isok ==true\n// var ft float64  beegoInput.Bind(&ft, \"ft\")  ft ==1.2\n// ol := make([]int, 0, 2)  beegoInput.Bind(&ol, \"ol\")  ol ==[1 2]\n// ul := make([]string, 0, 2)  beegoInput.Bind(&ul, \"ul\")  ul ==[str array]\n// user struct{Name}  beegoInput.Bind(&user, \"user\")  user == {Name:\"astaxie\"}\nfunc (input *BeegoInput) Bind(dest interface{}, key string) error {\n\tvalue := reflect.ValueOf(dest)\n\tif value.Kind() != reflect.Ptr {\n\t\treturn errors.New(\"beego: non-pointer passed to Bind: \" + key)\n\t}\n\tvalue = value.Elem()\n\tif !value.CanSet() {\n\t\treturn errors.New(\"beego: non-settable variable passed to Bind: \" + key)\n\t}\n\ttyp := value.Type()\n\t// Get real type if dest define with interface{}.\n\t// e.g  var dest interface{} dest=1.0\n\tif value.Kind() == reflect.Interface {\n\t\ttyp = value.Elem().Type()\n\t}\n\trv := input.bind(key, typ)\n\tif !rv.IsValid() {\n\t\treturn errors.New(\"beego: reflect value is empty\")\n\t}\n\tvalue.Set(rv)\n\treturn nil\n}","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/beego/beego/blob/939cfde380bb9f15844ad633b84f037f7da21584/server/web/context/input.go#L428-L464","documentation":"Error \"beego: non-pointer passed to Bind: ${key}\" thrown in beego/beego.","triggerScenarios":"Thrown at server/web/context/input.go:446 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":"939cfde380bb9f15844ad633b84f037f7da21584","analyzedAt":"2026-08-15T17:22:06.535Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}