関連記事 概要 サンプル 参考情報 Goのおすすめ書籍 関連記事 GitHub - devlights/blog-summary: ブログ「いろいろ備忘録日記」のまとめ 概要 以下、自分用のメモです。忘れない内にメモメモ。。。 テスト時に一時的なディレクトリが欲しくなることは結構ありますね。 testing.T.TempDir() を利用すると、一発で生成された一時ディレクトリパスが手に入るのでとても便利です。 以下の書籍で知りました。 Go言語プログラミングエッセンス エンジニア選書 作者:mattn技術評論社Amazon いつも自前で生成してテストしてました・・今後はこのメソッド利用します。 サンプル package main import ( "fmt" "os" "path/filepath" "testing" ) var ( tmpDir string ) func TestM