{"action":"opened","issue":{"url":"https://api.github.com/repos/spf13/viper/issues/453","repository_url":"https://api.github.com/repos/spf13/viper","labels_url":"https://api.github.com/repos/spf13/viper/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/spf13/viper/issues/453/comments","events_url":"https://api.github.com/repos/spf13/viper/issues/453/events","html_url":"https://github.com/spf13/viper/issues/453","id":294338621,"number":453,"title":"default value not apply to GetStringMapString","user":{"login":"marionzheng","id":2740859,"avatar_url":"https://avatars2.githubusercontent.com/u/2740859?v=4","gravatar_id":"","url":"https://api.github.com/users/marionzheng","html_url":"https://github.com/marionzheng","followers_url":"https://api.github.com/users/marionzheng/followers","following_url":"https://api.github.com/users/marionzheng/following{/other_user}","gists_url":"https://api.github.com/users/marionzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/marionzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionzheng/subscriptions","organizations_url":"https://api.github.com/users/marionzheng/orgs","repos_url":"https://api.github.com/users/marionzheng/repos","events_url":"https://api.github.com/users/marionzheng/events{/privacy}","received_events_url":"https://api.github.com/users/marionzheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-05T10:15:36Z","updated_at":"2018-02-05T10:15:36Z","closed_at":null,"author_association":"NONE","body":"codegen.toml\r\n\r\n```toml\r\n[codegen]\r\noutput_path = \"../model/\"\r\n```\r\n\r\ncode\r\n\r\n```golang\r\nviper.SetDefault(\"codegen.output_path\", \"../model/auto/\")\r\nviper.SetDefault(\"codegen.sub_model_output_path\", \"ddd\")\r\nviper.SetConfigName(\"codegen\")\r\nviper.AddConfigPath(\"./templates\")\r\nerr := viper.ReadInConfig()\r\nif err != nil {\r\n    panic(fmt.Errorf(\"Fatal error config file: %s \\n\", err))\r\n}\r\n\r\ncodegenCnf := viper.GetStringMapString(\"codegen\")\r\noutputPath := codegenCnf[\"output_path\"]\r\nsubModelOutputPath := codegenCnf[\"sub_model_output_path\"]\r\n\r\nfmt.Printf(\"%s\", subModelOutputPath)\r\n```\r\n\r\noutput \"\" not \"ddd\""}}
{"actor":{"display_login":"marionzheng"}}