Repository navigation
Conversation
ConfigFileNotFoundError has the Unwrap method (it returns FileNotFoundFromSearchError), so FileNotFoundFromSearchError is the wrapped error, not the wrapper. Use the bracket link form that the neighbouring ConfigFileNotFoundError comment already uses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview:
Doc-comment-only correction on
FileNotFoundFromSearchError(errors.go:36). The line reads// Wraps ConfigFileNotFoundError., which states the opposite of the actual relationship. It now reads// Wrapped by [ConfigFileNotFoundError]..What problem does it solve?:
ConfigFileNotFoundErroris the type that owns theUnwrapmethod, and it returns aFileNotFoundFromSearchError:FileNotFoundFromSearchErrorhas noUnwrap, and it is the only such method inerrors.go. SoConfigFileNotFoundErroris the outer error andFileNotFoundFromSearchErroris the one being wrapped — the current comment inverts that, which is the kind of line a reader trusts when working outerrors.Is/errors.Asbehaviour.I confirmed it at runtime rather than only by reading, with a throwaway test in the package (since removed, not part of the diff):
and
errors.Unwrap(FileNotFoundFromSearchError{})isnil.Two notes on wording:
ConfigFileNotFoundErrorcomment ([FileNotFoundFromSearchError]) so godoc renders the cross-reference.This is error wrapsgrammar typo on line 19. No overlap in hunks.Special notes for a reviewer:
No behavior change. Local checks:
gofmt -l .— cleango vet ./...— cleango test -count=1 ./...— all 5 packages ok (uncached)