You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
go 言語において呼び出し元に interface のみを公開することで実装の詳細を隠ぺいすると、gomock を使ったテストがやり易くなります。 ざっくり結論だけ書くとこんな感じのコーディングパターンにすると良いよって感じなので、これだけ見て、何が言いたいのかすぐに分かる人は続きを読まなくても良いと思います。 package intf type Duck interface { Quack() string } type duck struct {} func NewDuck() Duck { return &duck{} } func (d *duck) Quack() string { return "QUUAAAACCCCKK!!!" } interface と実装が分離されたアヒル 最初のポイントは、公開する interface として定義された Duck と非公開の stru
package main import ( "database/sql" "flag" "fmt" "os" "reflect" "sync" "testing" "github.com/ToQoz/gopwt" "github.com/ToQoz/gopwt/assert" ) func TestMain(m *testing.M) { flag.Parse() gopwt.Empower() // magic happens os.Exit(m.Run()) } func TestWithMessage(t *testing.T) { var receiver *struct{} receiver = nil assert.OK(t, receiver != nil, "receiver should not be nil") } func TestWithTestingRun(t *
Write behavioral tests in your editor. Get live results in your browser. Uses go test GoConvey supports Go's native testing package. Neither the web UI nor the DSL are required; you can use either one independently. Terminal or browser Since GoConvey integrates with go test, you can keep running tests in the terminal or use the auto-updating web UI for test results. Tell your program's story Thoug
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く