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
+1 -2
View File
@@ -5,13 +5,12 @@ import (
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v4/hrp"
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
)
func LoadJSONCase(path string) (*hrp.TestCase, error) {
log.Info().Str("path", path).Msg("load json case file")
caseJSON := new(hrp.TestCase)
err := builtin.LoadFile(path, caseJSON)
err := hrp.LoadFile(path, caseJSON)
if err != nil {
return nil, errors.Wrap(err, "load json file failed")
}