0
0

More than 3 years have passed since last update.

golangでテーブル駆動テスト(テーブルドリブンテスト)を並列実行で書く際の注意点

Posted at

なぜかテストが正しく動作しないことがあり、調べたら以下が原因でした

なぜ上記のようなことが起こるかというと、
https://play.golang.org/p/QIjYezj9RzR
を見たら分かる通り、for loopでloop毎に新しく変数を作っているのではなく、同じ変数を使いまわしているからですね

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0