{"image_url":null,"provider_name":"Hatena Blog","url":"https://int128.hatenablog.com/entry/2018/05/11/130517","categories":["golang"],"type":"rich","description":"Golang\u3067YAML\u3092\u8aad\u307f\u8fbc\u3080\u969b\u3001\u8981\u7d20\u306e\u578b\u304c\u5b9f\u884c\u6642\u306b\u6c7a\u307e\u308b\u5834\u5408\u3092\u8003\u3048\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306eYAML\u3067\u306f values \u3067\u6570\u5024\u3001\u6587\u5b57\u5217\u3001\u30de\u30c3\u30d7\u306e\u5024\u304c\u5217\u6319\u3055\u308c\u3066\u3044\u307e\u3059\u3002 values: - 100 - foo - key: value \u3053\u306e\u3088\u3046\u306aYAML\u3092\u8aad\u307f\u8fbc\u3080\u5834\u5408\u3001\u578b\u5ba3\u8a00\u3092 interface{} \u306b\u3059\u308b\u3068\u5b9f\u884c\u6642\u306b\u578b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u5024\u3092\u51e6\u7406\u3067\u304d\u307e\u3059\u3002 type Spec struct { Values []interface{} `yaml:\"values\"` } func main() { spec := Spec{} yaml.NewDecoder(file).Decode(&spec) f\u2026","blog_title":"GeekFactory","provider_url":"https://hatena.blog","height":"190","width":"100%","title":"Read dynamic type values from YAML in Golang","author_url":"https://blog.hatena.ne.jp/int128/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fint128.hatenablog.com%2Fentry%2F2018%2F05%2F11%2F130517\" title=\"Read dynamic type values from YAML in Golang - GeekFactory\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"int128","published":"2018-05-11 13:05:17","version":"1.0","blog_url":"https://int128.hatenablog.com/"}