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

@@ -12,6 +12,7 @@ import (
"github.com/tal-tech/go-zero/core/stringx"
conf "github.com/tal-tech/go-zero/tools/goctl/config"
"github.com/tal-tech/go-zero/tools/goctl/rpc/execx"
"github.com/tal-tech/go-zero/tools/goctl/util"
)
var cfg = &conf.Config{
@@ -57,7 +58,7 @@ func TestRpcGenerate(t *testing.T) {
// case go mod
t.Run("GOMOD", func(t *testing.T) {
workDir := t.TempDir()
workDir := util.MustTempDir()
name := filepath.Base(workDir)
_, err = execx.Run("go mod init "+name, workDir)
if err != nil {