{"record":{"id":"318345b9ab1434a5","repo":"beego/beego","slug":"key-is-empty-318345","errorCode":null,"errorMessage":"key is empty","messagePattern":"key is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config/yaml/yaml.go","lineNumber":322,"sourceCode":"\treturn err\n}\n\n// Set writes a new value for key.\nfunc (c *ConfigContainer) Set(key, val string) error {\n\tc.Lock()\n\tdefer c.Unlock()\n\tc.data[key] = val\n\treturn nil\n}\n\n// DIY returns the raw value by a given key.\nfunc (c *ConfigContainer) DIY(key string) (v interface{}, err error) {\n\treturn c.getData(key)\n}\n\nfunc (c *ConfigContainer) getData(key string) (interface{}, error) {\n\tif key == \"\" {\n\t\treturn nil, errors.New(\"key is empty\")\n\t}\n\tc.RLock()\n\tdefer c.RUnlock()\n\n\tkeys := strings.Split(key, \".\")\n\ttmpData := c.data\n\tfor idx, k := range keys {\n\t\tif v, ok := tmpData[k]; ok {\n\t\t\tswitch val := v.(type) {\n\t\t\tcase map[string]interface{}:\n\t\t\t\ttmpData = val\n\t\t\t\tif idx == len(keys)-1 {\n\t\t\t\t\treturn tmpData, nil\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn v, nil\n\t\t\t}\n\t\t}","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/beego/beego/blob/939cfde380bb9f15844ad633b84f037f7da21584/core/config/yaml/yaml.go#L304-L340","documentation":"Error \"key is empty\" thrown in beego/beego.","triggerScenarios":"Thrown at core/config/yaml/yaml.go:322 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"}