diff --git a/tools/gomod-local-update/internal/updater/updater.go b/tools/gomod-local-update/internal/updater/updater.go index 44c99fb273c..ffd4814d5f4 100644 --- a/tools/gomod-local-update/internal/updater/updater.go +++ b/tools/gomod-local-update/internal/updater/updater.go @@ -232,7 +232,7 @@ func (u *Updater) readModFile() (*modfile.File, error) { modFile, err := modfile.Parse(goModFile, content, nil) if err != nil { - return nil, fmt.Errorf("%w: invalid go.mod format: %w", ErrModOperation, err) // Changed %v to %w + return nil, fmt.Errorf("%w: invalid go.mod format: %w", ErrModOperation, err) } return modFile, nil diff --git a/tools/gomod-local-update/internal/updater/updater_test.go b/tools/gomod-local-update/internal/updater/updater_test.go index a08e17ddd7e..da1af2f97e0 100644 --- a/tools/gomod-local-update/internal/updater/updater_test.go +++ b/tools/gomod-local-update/internal/updater/updater_test.go @@ -24,7 +24,7 @@ func (m *mockGitExecutor) Command(ctx context.Context, args ...string) ([]byte, } remote := args[1] if remote == "invalid*remote" { - return nil, fmt.Errorf("%w: git remote '%s' contains invalid characters", ErrInvalidConfig, remote) // Fixed: added %w + return nil, fmt.Errorf("%w: git remote '%s' contains invalid characters", ErrInvalidConfig, remote) } // Return a full 40-character SHA fullSHA := fmt.Sprintf("%s%s", m.sha, strings.Repeat("0", 40-len(m.sha)))