Add MustTempDir (#1069)

This commit is contained in:
anqiansong
2021-09-21 10:13:43 +08:00
committed by GitHub
parent 30e49f2939
commit 9a724fe907
11 changed files with 48 additions and 25 deletions

View File

@@ -5,16 +5,18 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/tal-tech/go-zero/tools/goctl/util"
)
func TestProtoTmpl(t *testing.T) {
_ = Clean()
// exists dir
err := ProtoTmpl(t.TempDir())
err := ProtoTmpl(util.MustTempDir())
assert.Nil(t, err)
// not exist dir
dir := filepath.Join(t.TempDir(), "test")
dir := filepath.Join(util.MustTempDir(), "test")
err = ProtoTmpl(dir)
assert.Nil(t, err)
}