Skip to content

Alias stdlib errors import to avoid ambiguity in pkg/errors#27208

Merged
gwossum merged 2 commits intogw/errors_captureffrom
copilot/sub-pr-27207
Feb 10, 2026
Merged

Alias stdlib errors import to avoid ambiguity in pkg/errors#27208
gwossum merged 2 commits intogw/errors_captureffrom
copilot/sub-pr-27207

Conversation

Copy link

Copilot AI commented Feb 10, 2026

In a package named errors, unaliased stdlib errors imports make call sites ambiguous—errors.Join(...) could refer to either the package or stdlib.

Changes

  • Aliased stdlib import as stderrors in pkg/errors/error_capture.go and pkg/errors/error_capture_test.go
  • Updated errors.Join()stderrors.Join() and errors.New()stderrors.New()
import (
	stderrors "errors"
	"fmt"
)

// Now unambiguous
*rErr = stderrors.Join(*rErr, err)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: gwossum <10836954+gwossum@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP to address feedback on 'feat: add Capturef' PR Alias stdlib errors import to avoid ambiguity in pkg/errors Feb 10, 2026
Copilot AI requested a review from gwossum February 10, 2026 18:59
Copy link
Member

@gwossum gwossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gwossum gwossum marked this pull request as ready for review February 10, 2026 19:32
@gwossum gwossum merged commit fa5c0aa into gw/errors_capturef Feb 10, 2026
8 of 10 checks passed
@gwossum gwossum deleted the copilot/sub-pr-27207 branch February 10, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants