diff --git a/pkg/workflow/apm_dependencies_test.go b/pkg/workflow/apm_dependencies_test.go index f10ae1d6916..f556897ffac 100644 --- a/pkg/workflow/apm_dependencies_test.go +++ b/pkg/workflow/apm_dependencies_test.go @@ -952,7 +952,7 @@ func TestExtractAPMDependenciesFromImportsAPMPackages(t *testing.T) { "dependencies": []any{"microsoft/from-dependencies"}, } result, err := extractAPMDependenciesFromFrontmatter(frontmatter) - assert.Error(t, err, "Should return an error when both imports.apm-packages and dependencies are present") + require.Error(t, err, "Should return an error when both imports.apm-packages and dependencies are present") assert.Nil(t, result, "Should return nil result on error") assert.Contains(t, err.Error(), "imports.apm-packages", "Error should mention imports.apm-packages") assert.Contains(t, err.Error(), "dependencies", "Error should mention dependencies") diff --git a/pkg/workflow/frontmatter_extraction_metadata.go b/pkg/workflow/frontmatter_extraction_metadata.go index 2d5f42728eb..b31570d5f06 100644 --- a/pkg/workflow/frontmatter_extraction_metadata.go +++ b/pkg/workflow/frontmatter_extraction_metadata.go @@ -1,6 +1,7 @@ package workflow import ( + "errors" "fmt" "maps" "os" @@ -269,10 +270,10 @@ func extractAPMDependenciesFromFrontmatter(frontmatter map[string]any) (*APMDepe // It is an error to specify both sources simultaneously. if hasImportsAPM && hasDependencies { - return nil, fmt.Errorf( - "cannot use both 'imports.apm-packages' and 'dependencies' simultaneously. " + - "Remove 'dependencies' and use 'imports.apm-packages' exclusively. " + - "Run 'gh aw fix --write' to automatically migrate.", + return nil, errors.New( + "cannot use both 'imports.apm-packages' and 'dependencies' simultaneously; " + + "remove 'dependencies' and use 'imports.apm-packages' exclusively; " + + "run 'gh aw fix --write' to automatically migrate", ) }