change: rename LoadFile to LoadFileObject

This commit is contained in:
lilong.129
2024-08-19 22:47:13 +08:00
parent 89d0d4bb96
commit 98ce2cc818
10 changed files with 13 additions and 13 deletions

View File

@@ -370,7 +370,7 @@ func LoadHARCase(path string) (*hrp.TestCase, error) {
func loadCaseHAR(path string) (*CaseHar, error) {
caseHAR := new(CaseHar)
err := hrp.LoadFile(path, caseHAR)
err := hrp.LoadFileObject(path, caseHAR)
if err != nil {
return nil, errors.Wrap(err, "load har file failed")
}

View File

@@ -10,7 +10,7 @@ import (
func LoadJSONCase(path string) (*hrp.TestCase, error) {
log.Info().Str("path", path).Msg("load json case file")
caseJSON := new(hrp.TestCase)
err := hrp.LoadFile(path, caseJSON)
err := hrp.LoadFileObject(path, caseJSON)
if err != nil {
return nil, errors.Wrap(err, "load json file failed")
}

View File

@@ -124,7 +124,7 @@ func LoadPostmanCase(path string) (*hrp.TestCase, error) {
func loadCasePostman(path string) (*CasePostman, error) {
casePostman := new(CasePostman)
err := hrp.LoadFile(path, casePostman)
err := hrp.LoadFileObject(path, casePostman)
if err != nil {
return nil, errors.Wrap(err, "load postman file failed")
}

View File

@@ -10,7 +10,7 @@ import (
func LoadSwaggerCase(path string) (*hrp.TestCase, error) {
// load swagger file
caseSwagger := new(spec.Swagger)
err := hrp.LoadFile(path, caseSwagger)
err := hrp.LoadFileObject(path, caseSwagger)
if err != nil {
return nil, errors.Wrap(err, "load swagger file failed")
}

View File

@@ -11,7 +11,7 @@ import (
func LoadYAMLCase(path string) (*hrp.TestCase, error) {
// load yaml case file
caseJSON := new(hrp.TestCase)
err := hrp.LoadFile(path, caseJSON)
err := hrp.LoadFileObject(path, caseJSON)
if err != nil {
return nil, errors.Wrap(err, "load yaml file failed")
}

View File

@@ -198,7 +198,7 @@ func (c *TCaseConverter) genOutputPath(suffix string) string {
func (c *TCaseConverter) overrideWithProfile(path string) error {
log.Info().Str("path", path).Msg("load profile")
profile := new(Profile)
err := hrp.LoadFile(path, profile)
err := hrp.LoadFileObject(path, profile)
if err != nil {
log.Warn().Str("path", path).
Msg("failed to load profile, ignore!")