refactor: move LoadFile to hrp/loader

This commit is contained in:
lilong.129
2024-08-19 22:42:53 +08:00
parent a9b864dc96
commit 89d0d4bb96
13 changed files with 106 additions and 109 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ type TestCasePath string
func (path *TestCasePath) GetTestCase() (*TestCase, error) {
tc := &TestCase{}
casePath := string(*path)
err := builtin.LoadFile(casePath, tc)
err := LoadFile(casePath, tc)
if err != nil {
return nil, err
}
@@ -137,7 +137,7 @@ func (tc *TestCase) loadISteps() (*TestCase, error) {
dotEnvPath := filepath.Join(projectRootDir, ".env")
if builtin.IsFilePathExists(dotEnvPath) {
envVars := make(map[string]string)
err = builtin.LoadFile(dotEnvPath, envVars)
err = LoadFile(dotEnvPath, envVars)
if err != nil {
return nil, errors.Wrap(err, "failed to load .env file")
}