diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f792f37a..1ace1dd1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: version: v1.51.1 - run: go build ./cmd/goverter - run: go test -coverpkg ./... -coverprofile=coverage.txt -covermode=atomic ./... - - run: bash <(curl -s https://codecov.io/bash) + - uses: codecov/codecov-action@v3 'build_go116': runs-on: ubuntu-latest steps: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..f2a47527 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + project: + default: + target: 90% + patch: + default: + target: 90% diff --git a/runner_test.go b/runner_test.go index f6e6ae19..29328d37 100644 --- a/runner_test.go +++ b/runner_test.go @@ -2,7 +2,6 @@ package goverter import ( "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -18,32 +17,39 @@ import ( ) func TestScenario(t *testing.T) { - curPath := getCurrentPath() - scenarios := filepath.Join(curPath, "scenario") - execDir := filepath.Join(curPath, "execution") - files, err := ioutil.ReadDir(scenarios) + rootDir := getCurrentPath() + scenarioDir := filepath.Join(rootDir, "scenario") + workDir := filepath.Join(rootDir, "execution") + scenarioFiles, err := os.ReadDir(scenarioDir) require.NoError(t, err) + require.NoError(t, clearDir(workDir)) - require.NoError(t, os.MkdirAll(execDir, os.ModePerm)) - require.NoError(t, clearDir(execDir)) - - for _, file := range files { + for _, file := range scenarioFiles { require.False(t, file.IsDir(), "should not be a directory") + file := file + + testName := strings.TrimSuffix(file.Name(), filepath.Ext(file.Name())) - t.Run(file.Name(), func(t *testing.T) { - scenarioFileName := filepath.Join(scenarios, file.Name()) - scenarioBytes, err := ioutil.ReadFile(scenarioFileName) + t.Run(testName, func(t *testing.T) { + t.Parallel() + testWorkDir := filepath.Join(workDir, testName) + require.NoError(t, os.MkdirAll(testWorkDir, os.ModePerm)) + require.NoError(t, clearDir(testWorkDir)) + scenarioFilePath := filepath.Join(scenarioDir, file.Name()) + scenarioFileBytes, err := os.ReadFile(scenarioFilePath) require.NoError(t, err) scenario := Scenario{} - err = yaml.Unmarshal(scenarioBytes, &scenario) + err = yaml.Unmarshal(scenarioFileBytes, &scenario) + require.NoError(t, err) + err = os.WriteFile(filepath.Join(testWorkDir, "go.mod"), []byte("module github.com/jmattheis/goverter/execution\ngo 1.16"), os.ModePerm) require.NoError(t, err) for name, content := range scenario.Input { - inPath := filepath.Join(execDir, name) + inPath := filepath.Join(testWorkDir, name) err = os.MkdirAll(filepath.Dir(inPath), os.ModePerm) require.NoError(t, err) - err = os.WriteFile(filepath.Join(execDir, name), []byte(content), os.ModePerm) + err = os.WriteFile(filepath.Join(testWorkDir, name), []byte(content), os.ModePerm) require.NoError(t, err) } genPkgName := "generated" @@ -57,7 +63,7 @@ func TestScenario(t *testing.T) { files, err := generateConvertersRaw( &GenerateConfig{ - WorkingDir: execDir, + WorkingDir: testWorkDir, PackagePatterns: patterns, Global: config.RawLines{ Lines: global, @@ -65,32 +71,32 @@ func TestScenario(t *testing.T) { }, }) - actualOutputFiles := toOutputFiles(execDir, files) + actualOutputFiles := toOutputFiles(testWorkDir, files) - if os.Getenv("UPDATE_SCENARIO") == "true" && scenario.ErrorStartsWith == "" { + if scenario.ErrorStartsWith != "" { + require.Error(t, err) + strErr := replaceAbsolutePath(testWorkDir, fmt.Sprint(err)) + require.Equal(t, scenario.ErrorStartsWith, strErr[:len(scenario.ErrorStartsWith)]) + return + } + + if os.Getenv("UPDATE_SCENARIO") == "true" { if err != nil { scenario.Success = []*OutputFile{} - scenario.Error = replaceAbsolutePath(curPath, fmt.Sprint(err)) + scenario.Error = replaceAbsolutePath(testWorkDir, fmt.Sprint(err)) } else { - scenario.Success = toOutputFiles(execDir, files) + scenario.Success = toOutputFiles(testWorkDir, files) scenario.Error = "" } newBytes, err := yaml.Marshal(&scenario) if assert.NoError(t, err) { - os.WriteFile(scenarioFileName, newBytes, os.ModePerm) + os.WriteFile(scenarioFilePath, newBytes, os.ModePerm) } } - if scenario.ErrorStartsWith != "" { - require.Error(t, err) - strErr := replaceAbsolutePath(curPath, fmt.Sprint(err)) - require.Equal(t, scenario.ErrorStartsWith, strErr[:len(scenario.ErrorStartsWith)]) - return - } - if scenario.Error != "" { require.Error(t, err) - require.Equal(t, scenario.Error, replaceAbsolutePath(curPath, fmt.Sprint(err))) + require.Equal(t, scenario.Error, replaceAbsolutePath(testWorkDir, fmt.Sprint(err))) return } @@ -100,16 +106,13 @@ func TestScenario(t *testing.T) { err = writeFiles(files) require.NoError(t, err) - require.NoError(t, compile(execDir), "generated converter doesn't build") + require.NoError(t, compile(testWorkDir), "generated converter doesn't build") }) - if os.Getenv("SKIP_CLEAN") != "true" { - clearDir(execDir) - } } } func replaceAbsolutePath(curPath, body string) string { - return strings.ReplaceAll(body, curPath, "/ABSOLUTE") + return strings.ReplaceAll(body, curPath, "@workdir") } func compile(dir string) error { diff --git a/scenario/bool_setting_invalid_value.yml b/scenario/bool_setting_invalid_value.yml index 32b092c9..13f889af 100644 --- a/scenario/bool_setting_invalid_value.yml +++ b/scenario/bool_setting_invalid_value.yml @@ -12,7 +12,7 @@ input: type Output struct { Name string } error: |- error parsing 'goverter:useZeroValueOnPointerInconsistency' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter invalid boolean value: 'abc' must be one of 'yes', 'no' diff --git a/scenario/bool_setting_too_many_values.yml b/scenario/bool_setting_too_many_values.yml index bf7114ab..e8990553 100644 --- a/scenario/bool_setting_too_many_values.yml +++ b/scenario/bool_setting_too_many_values.yml @@ -12,7 +12,7 @@ input: type Output struct { Name string } error: |- error parsing 'goverter:useZeroValueOnPointerInconsistency' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter expected at most one value but got 2: []string{"1", "2"} diff --git a/scenario/extend_external_exact_name_missing.yml b/scenario/extend_external_exact_name_missing.yml index 2ed2532a..1cc77369 100644 --- a/scenario/extend_external_exact_name_missing.yml +++ b/scenario/extend_external_exact_name_missing.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter ParseSomething does not exist in scope diff --git a/scenario/extend_external_pattern_zero_matches.yml b/scenario/extend_external_pattern_zero_matches.yml index 79e4e063..01e82e71 100644 --- a/scenario/extend_external_pattern_zero_matches.yml +++ b/scenario/extend_external_pattern_zero_matches.yml @@ -9,7 +9,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:6:1 + @workdir/input.go:6:1 github.com/jmattheis/goverter/execution.Converter package strconv does not have methods with names that match diff --git a/scenario/extend_external_unexported_error.yml b/scenario/extend_external_unexported_error.yml index 95db927c..b9c79125 100644 --- a/scenario/extend_external_unexported_error.yml +++ b/scenario/extend_external_unexported_error.yml @@ -23,7 +23,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:6:1 + @workdir/input.go:6:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_name_pattern_required.yml b/scenario/extend_name_pattern_required.yml index 045630fb..96866a26 100644 --- a/scenario/extend_name_pattern_required.yml +++ b/scenario/extend_name_pattern_required.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter method name pattern is required in the custom method "strconv:". diff --git a/scenario/extend_name_pattern_wrong_regexp.yml b/scenario/extend_name_pattern_wrong_regexp.yml index e8708a11..d2652180 100644 --- a/scenario/extend_name_pattern_wrong_regexp.yml +++ b/scenario/extend_name_pattern_wrong_regexp.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter could not parse name as regexp "(": error parsing regexp: missing closing ): `(` diff --git a/scenario/extend_no_packages_loaded.yml b/scenario/extend_no_packages_loaded.yml index 728e93f4..459420b9 100644 --- a/scenario/extend_no_packages_loaded.yml +++ b/scenario/extend_no_packages_loaded.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter no packages were loaded for "file=/nonexisting", make sure it is a valid golang package diff --git a/scenario/extend_not_exist.yml b/scenario/extend_not_exist.yml index f129fa6d..3739c9a5 100644 --- a/scenario/extend_not_exist.yml +++ b/scenario/extend_not_exist.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter HelloWorld does not exist in scope diff --git a/scenario/extend_package_path_required.yml b/scenario/extend_package_path_required.yml index 3293638b..76454a9a 100644 --- a/scenario/extend_package_path_required.yml +++ b/scenario/extend_package_path_required.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter package path must not be empty in the custom method ":Convert". diff --git a/scenario/extend_package_unexported_method.yml b/scenario/extend_package_unexported_method.yml index 8dd3a8b7..a1da6e9b 100644 --- a/scenario/extend_package_unexported_method.yml +++ b/scenario/extend_package_unexported_method.yml @@ -21,7 +21,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_packages_load_failure.yml b/scenario/extend_packages_load_failure.yml index bc94cccd..56a64fa7 100644 --- a/scenario/extend_packages_load_failure.yml +++ b/scenario/extend_packages_load_failure.yml @@ -8,7 +8,7 @@ input: } error_starts_with: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter packages load failed on "notaquery=abc": invalid query type "notaquery" diff --git a/scenario/extend_pattern_zero_matches.yml b/scenario/extend_pattern_zero_matches.yml index f697016f..857d0f1f 100644 --- a/scenario/extend_pattern_zero_matches.yml +++ b/scenario/extend_pattern_zero_matches.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter local package does not have methods with names that match the golang regexp pattern "HelloWorld.*" and a convert signature diff --git a/scenario/extend_wrong_package.yml b/scenario/extend_wrong_package.yml index 311e5cbb..0012cc44 100644 --- a/scenario/extend_wrong_package.yml +++ b/scenario/extend_wrong_package.yml @@ -8,7 +8,7 @@ input: } error_starts_with: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter failed to load package "wrong/package", try adding a blank import for it diff --git a/scenario/extend_wrong_source.yml b/scenario/extend_wrong_source.yml index e8c008f7..9494f9a1 100644 --- a/scenario/extend_wrong_source.yml +++ b/scenario/extend_wrong_source.yml @@ -11,7 +11,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_wrong_source_converter.yml b/scenario/extend_wrong_source_converter.yml index 5229e886..4140a9de 100644 --- a/scenario/extend_wrong_source_converter.yml +++ b/scenario/extend_wrong_source_converter.yml @@ -11,7 +11,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_wrong_target.yml b/scenario/extend_wrong_target.yml index 2273275d..faec6a21 100644 --- a/scenario/extend_wrong_target.yml +++ b/scenario/extend_wrong_target.yml @@ -10,7 +10,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_wrong_target_second.yml b/scenario/extend_wrong_target_second.yml index 1e13bc3e..d3e6a82f 100644 --- a/scenario/extend_wrong_target_second.yml +++ b/scenario/extend_wrong_target_second.yml @@ -11,7 +11,7 @@ input: } error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/extend_wrong_type.yml b/scenario/extend_wrong_type.yml index b8cd0af2..ead22ab1 100644 --- a/scenario/extend_wrong_type.yml +++ b/scenario/extend_wrong_type.yml @@ -9,7 +9,7 @@ input: const HelloWorld = 5 error: |- error parsing 'goverter:extend' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter error parsing type: diff --git a/scenario/invalid_comment_const.yml b/scenario/invalid_comment_const.yml index 499f5b70..43ab648d 100644 --- a/scenario/invalid_comment_const.yml +++ b/scenario/invalid_comment_const.yml @@ -4,4 +4,4 @@ input: // goverter:converter const x = 5 -error: '/ABSOLUTE/execution/input.go:4:1: goverter:converter may only be applied to type declarations ' +error: '@workdir/input.go:4:1: goverter:converter may only be applied to type declarations ' diff --git a/scenario/invalid_converter_comment.yml b/scenario/invalid_converter_comment.yml index fce257bf..2ca5f351 100644 --- a/scenario/invalid_converter_comment.yml +++ b/scenario/invalid_converter_comment.yml @@ -11,4 +11,4 @@ input: } ) -error: '/ABSOLUTE/execution/input.go:4:1: found goverter:converter on type but it has multiple interfaces inside' +error: '@workdir/input.go:4:1: found goverter:converter on type but it has multiple interfaces inside' diff --git a/scenario/invalid_interface.yml b/scenario/invalid_interface.yml index 63bb4602..c1394313 100644 --- a/scenario/invalid_interface.yml +++ b/scenario/invalid_interface.yml @@ -4,4 +4,4 @@ input: // goverter:converter type Converter struct {} -error: '/ABSOLUTE/execution/input.go:4:1: goverter:converter may only be applied to type interface declarations ' +error: '@workdir/input.go:4:1: goverter:converter may only be applied to type interface declarations ' diff --git a/scenario/invalid_interface2.yml b/scenario/invalid_interface2.yml index a6fd3138..9d35e9d8 100644 --- a/scenario/invalid_interface2.yml +++ b/scenario/invalid_interface2.yml @@ -6,4 +6,4 @@ input: // goverter:converter Converter struct {} ) -error: '/ABSOLUTE/execution/input.go:3:1: goverter:converter may only be applied to type interface declarations ' +error: '@workdir/input.go:3:1: goverter:converter may only be applied to type interface declarations ' diff --git a/scenario/invalid_meta.yml b/scenario/invalid_meta.yml index cdf58d14..f7d8daf5 100644 --- a/scenario/invalid_meta.yml +++ b/scenario/invalid_meta.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:not_existing' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter unknown setting: not_existing diff --git a/scenario/invalid_meta2.yml b/scenario/invalid_meta2.yml index e2cab37d..48d09480 100644 --- a/scenario/invalid_meta2.yml +++ b/scenario/invalid_meta2.yml @@ -9,7 +9,7 @@ input: ) error: |- error parsing 'goverter:not_existing' at - /ABSOLUTE/execution/input.go:6:15 + @workdir/input.go:6:15 github.com/jmattheis/goverter/execution.Converter unknown setting: not_existing diff --git a/scenario/invalid_meta_empty.yml b/scenario/invalid_meta_empty.yml index 499a020f..e53de0fd 100644 --- a/scenario/invalid_meta_empty.yml +++ b/scenario/invalid_meta_empty.yml @@ -9,7 +9,7 @@ input: ) error: |- error parsing 'goverter:' at - /ABSOLUTE/execution/input.go:6:15 + @workdir/input.go:6:15 github.com/jmattheis/goverter/execution.Converter missing setting key diff --git a/scenario/invalid_method_comment_param.yml b/scenario/invalid_method_comment_param.yml index ec4935db..50f8c382 100644 --- a/scenario/invalid_method_comment_param.yml +++ b/scenario/invalid_method_comment_param.yml @@ -9,7 +9,7 @@ input: } error: |- error parsing 'goverter:oops' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).ConvertString(source string) string unknown setting: oops diff --git a/scenario/invalid_method_comment_param2.yml b/scenario/invalid_method_comment_param2.yml index 21b25681..282728cc 100644 --- a/scenario/invalid_method_comment_param2.yml +++ b/scenario/invalid_method_comment_param2.yml @@ -11,7 +11,7 @@ input: ) error: |- error parsing 'goverter:oops' at - /ABSOLUTE/execution/input.go:7:9 + @workdir/input.go:7:9 func (github.com/jmattheis/goverter/execution.Converter).ConvertString(source string) string unknown setting: oops diff --git a/scenario/invalid_method_comment_param_empty.yml b/scenario/invalid_method_comment_param_empty.yml index 416bb44b..037520d7 100644 --- a/scenario/invalid_method_comment_param_empty.yml +++ b/scenario/invalid_method_comment_param_empty.yml @@ -11,7 +11,7 @@ input: ) error: |- error parsing 'goverter:' at - /ABSOLUTE/execution/input.go:7:9 + @workdir/input.go:7:9 func (github.com/jmattheis/goverter/execution.Converter).ConvertString(source string) string missing setting key diff --git a/scenario/map_custom_error_too_many_params.yml b/scenario/map_custom_error_too_many_params.yml index 03bebaf0..67edbe89 100644 --- a/scenario/map_custom_error_too_many_params.yml +++ b/scenario/map_custom_error_too_many_params.yml @@ -20,7 +20,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_error_with_no_value_return.yml b/scenario/map_custom_error_with_no_value_return.yml index 66d62acc..e8df409c 100644 --- a/scenario/map_custom_error_with_no_value_return.yml +++ b/scenario/map_custom_error_with_no_value_return.yml @@ -20,7 +20,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_error_with_non_func_ref.yml b/scenario/map_custom_error_with_non_func_ref.yml index 5c035971..c99c6b40 100644 --- a/scenario/map_custom_error_with_non_func_ref.yml +++ b/scenario/map_custom_error_with_non_func_ref.yml @@ -18,7 +18,7 @@ input: const PluckAgeInt = 24 error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_error_with_ref_not_exist.yml b/scenario/map_custom_error_with_ref_not_exist.yml index 4587bbe0..a706d2d5 100644 --- a/scenario/map_custom_error_with_ref_not_exist.yml +++ b/scenario/map_custom_error_with_ref_not_exist.yml @@ -17,7 +17,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output PluckAgeInt does not exist in scope diff --git a/scenario/map_custom_error_wrong_type.yml b/scenario/map_custom_error_wrong_type.yml index ad1b70f6..028e021e 100644 --- a/scenario/map_custom_error_wrong_type.yml +++ b/scenario/map_custom_error_wrong_type.yml @@ -20,7 +20,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_external_compile_error.yml b/scenario/map_custom_external_compile_error.yml index e30242a8..5d9718ee 100644 --- a/scenario/map_custom_external_compile_error.yml +++ b/scenario/map_custom_external_compile_error.yml @@ -21,7 +21,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output failed to load package "github.com/jmattheis/goverter/execution/external", try adding a blank import for it: -: # github.com/jmattheis/goverter/execution/external diff --git a/scenario/map_custom_external_empty_package.yml b/scenario/map_custom_external_empty_package.yml index da0dade6..13a86856 100644 --- a/scenario/map_custom_external_empty_package.yml +++ b/scenario/map_custom_external_empty_package.yml @@ -16,7 +16,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output package path must not be empty in the custom method ":IntToString". diff --git a/scenario/map_custom_external_too_many_packages.yml b/scenario/map_custom_external_too_many_packages.yml index bcfddb78..513b45b4 100644 --- a/scenario/map_custom_external_too_many_packages.yml +++ b/scenario/map_custom_external_too_many_packages.yml @@ -21,7 +21,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output 'github.com/jmattheis/goverter/...:IntToString' package path matches multiple packages, it must match exactly one diff --git a/scenario/map_custom_external_unexported_error.yml b/scenario/map_custom_external_unexported_error.yml index 75a9a9e9..b5df9007 100644 --- a/scenario/map_custom_external_unexported_error.yml +++ b/scenario/map_custom_external_unexported_error.yml @@ -21,7 +21,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_invalid_method.yml b/scenario/map_custom_invalid_method.yml index 60e8837c..36a1b172 100644 --- a/scenario/map_custom_invalid_method.yml +++ b/scenario/map_custom_invalid_method.yml @@ -20,7 +20,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_custom_too_many_params.yml b/scenario/map_custom_too_many_params.yml index 8611b31b..f602a3bb 100644 --- a/scenario/map_custom_too_many_params.yml +++ b/scenario/map_custom_too_many_params.yml @@ -20,7 +20,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).Convert(source github.com/jmattheis/goverter/execution.Input) github.com/jmattheis/goverter/execution.Output error parsing type: diff --git a/scenario/map_invalid.yml b/scenario/map_invalid.yml index d7346ec8..0b894d49 100644 --- a/scenario/map_invalid.yml +++ b/scenario/map_invalid.yml @@ -17,7 +17,7 @@ input: } error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).ConvertPerson(source github.com/jmattheis/goverter/execution.Person) github.com/jmattheis/goverter/execution.APIPerson missing target field diff --git a/scenario/map_too_many_params.yml b/scenario/map_too_many_params.yml index ee651eac..e957ca12 100644 --- a/scenario/map_too_many_params.yml +++ b/scenario/map_too_many_params.yml @@ -11,7 +11,7 @@ input: ) error: |- error parsing 'goverter:map' at - /ABSOLUTE/execution/input.go:7:9 + @workdir/input.go:7:9 func (github.com/jmattheis/goverter/execution.Converter).ConvertString(source string) string too many fields expected at most 2 fields got 3: a b c diff --git a/scenario/match_ignore_case_invalid_comment.yml b/scenario/match_ignore_case_invalid_comment.yml index 7859ba7c..8129808d 100644 --- a/scenario/match_ignore_case_invalid_comment.yml +++ b/scenario/match_ignore_case_invalid_comment.yml @@ -9,7 +9,7 @@ input: } error: |- error parsing 'goverter:matchIgnoreCase' at - /ABSOLUTE/execution/input.go:6:5 + @workdir/input.go:6:5 func (github.com/jmattheis/goverter/execution.Converter).ConvertString(source string) string invalid boolean value: 'a' must be one of 'yes', 'no' diff --git a/scenario/name_invalid.yml b/scenario/name_invalid.yml index 0a3e202b..da7c7b20 100644 --- a/scenario/name_invalid.yml +++ b/scenario/name_invalid.yml @@ -8,7 +8,7 @@ input: } error: |- error parsing 'goverter:name' at - /ABSOLUTE/execution/input.go:5:1 + @workdir/input.go:5:1 github.com/jmattheis/goverter/execution.Converter must have one value but got 2: "a b" diff --git a/scenario/output_package_mismatch.yml b/scenario/output_package_mismatch.yml index 1aa9164f..ad327db7 100644 --- a/scenario/output_package_mismatch.yml +++ b/scenario/output_package_mismatch.yml @@ -22,14 +22,14 @@ input: } error: |- Error creating converters - /ABSOLUTE/execution/input.go + @workdir/input.go github.com/jmattheis/goverter/execution.Converter and - /ABSOLUTE/execution/input.go + @workdir/input.go github.com/jmattheis/goverter/execution.Converter2 Cannot use different packages pkg1 pkg2 in the same output file: - /ABSOLUTE/execution/generated/generated.go + @workdir/generated/generated.go