{"blog_title":"0xf","height":"190","type":"rich","title":"golang \u306e Example Testing \u521d\u3081\u3066\u89e6\u3063\u305f\u3051\u3069\u3053\u308c\u306f\u4fbf\u5229\u3058\u3083\u3093","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2F0xf.hatenablog.com%2Fentry%2F2024%2F10%2F16%2F183923\" title=\"golang \u306e Example Testing \u521d\u3081\u3066\u89e6\u3063\u305f\u3051\u3069\u3053\u308c\u306f\u4fbf\u5229\u3058\u3083\u3093 - 0xf\" 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":"ma2saka","width":"100%","url":"https://0xf.hatenablog.com/entry/2024/10/16/183923","version":"1.0","provider_name":"Hatena Blog","provider_url":"https://hatena.blog","blog_url":"https://0xf.hatenablog.com/","categories":["\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","golang"],"author_url":"https://blog.hatena.ne.jp/ma2saka/","description":"//main.go package main import ( \"fmt\" \"os\" ) func main() { os.Exit(_main()) } func _main() int { fmt.Println(\"hello world\") return 0 } \u3053\u3046\u3044\u3046\u611f\u3058\u306b\u306a\u3063\u3066\u305f\u3068\u304d\u3001 //main_test.go package main func _mainTest() { _main() } func ExampleTest_main() { _mainTest() // Output: // hello world (bad) } \u3068\u3057\u3066\u304a\u304f\u3068\u3001 % go test . o\u2026","image_url":null,"published":"2024-10-16 18:39:23"}