2017/12/19 Tech Night @ Shiodome # 6 https://techsio.connpass.com/event/72585/
![組織にテストを書く文化を根付かせる戦略と戦術 / Strategy and Tactics of Building Automated Testing Culture into Organization](https://cdn-ak-scissors.b.st-hatena.com/image/square/0baf65c1044ce43d0d03a0eadac56038e812187f/height=288;version=1;width=512/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2F745091ac938045cba48ee0c364e7cbbe%2Fslide_0.jpg%3F9210464)
In Go1.7, `testing` package will supports subtests and sub-benchmarks. With this feature, you can define tests/benchmarks in a test/benchmark function. It’s easy to create hierarchical tests or table-driven sub-benchmarks. It also provides a way to share common setup and tear-down code. This feature may have less benefits on tests because normally table-driven tests is enough. It will improve your
net/httptestでgojiのテストをする¶ goji でWebアプリを書こうとしていま す。APIサーバーとして使うときに、テストが気になります。 golangは net/http/httptest というhttpのtestを行うパッ ケージが最初からついています。これを使うと簡単にテストを記述できます。 httptest.Serverはlocalのloopbackインタフェースでサーバーを作成します。 (2014/11/20追記): mopemopeさんから「Routingのテストを入れたほうがいいのでは」というご指摘を受けたので、Route設定を別関数に分け、テストからも使うようにしました。 サンプルアプリ¶ /hello/hoge というURLにアクセスが来たらJSONを返す、という単純なア プリです。 package main import ( "encoding/json
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く