improve function gdebug.TestDataPath and update all usage codes

This commit is contained in:
John
2020-03-21 19:41:05 +08:00
parent 16958413bb
commit c2966817ce
14 changed files with 42 additions and 42 deletions

View File

@ -10,10 +10,10 @@ import (
"path/filepath"
)
// TestDataPath retrieves and returns the testdata path of current package.
// It is used for unit testing cases only.
// The parameter <names> specifies the underlying sub-folders/sub-files,
// which will be joined with current system separator.
// TestDataPath retrieves and returns the testdata path of current package,
// which is used for unit testing cases only.
// The parameter <names> specifies the its sub-folders/sub-files,
// which will be joined with current system separator and returned with the path.
func TestDataPath(names ...string) string {
path := CallerDirectory() + string(filepath.Separator) + "testdata"
for _, name := range names {