Documentation ¶
Index ¶
- func FileAnnotationForErrorWithPos(errorWithPos reporter.ErrorWithPos, options ...FileAnnotationOption) (bufanalysis.FileAnnotation, error)
- func FileAnnotationSetForErrorsWithPos(errorsWithPos []reporter.ErrorWithPos, options ...FileAnnotationOption) (bufanalysis.FileAnnotationSet, error)
- type FileAnnotationOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileAnnotationForErrorWithPos ¶
func FileAnnotationForErrorWithPos( errorWithPos reporter.ErrorWithPos, options ...FileAnnotationOption, ) (bufanalysis.FileAnnotation, error)
FileAnnotationForErrorWithPos returns a new FileAnnotation for the ErrorWithPos.
This special-cases fs.PathErrors if there is FileInfo information. We know that if there is FileInfo information, and there is a fs.PathError, this can only happen due to import errors. Therefore, we print out a special message saying that the error is for an import.
func FileAnnotationSetForErrorsWithPos ¶
func FileAnnotationSetForErrorsWithPos( errorsWithPos []reporter.ErrorWithPos, options ...FileAnnotationOption, ) (bufanalysis.FileAnnotationSet, error)
FileAnnotationSetForErrorWithPos returns new FileAnnotations for the ErrorsWithPos.
This special-cases fs.PathErrors if there is FileInfo information. We know that if there is FileInfo information, and there is a fs.PathError, this can only happen due to import errors. Therefore, we print out a special message saying that the error is for an import.
Types ¶
type FileAnnotationOption ¶
type FileAnnotationOption func(*fileAnnotationOptions)
FileAnnotationOption is an option when creating a FileAnnotation.
func WithExternalPathResolver ¶
func WithExternalPathResolver(externalPathResolver func(path string) string) FileAnnotationOption
WithExternalPathResolver returns a new FileAnnotationOption that will map the given path to an external path.