analysis

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package analysis offers helpers for an easier and nicer reporting

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Report

func Report(pass *analysis.Pass, message string, corruptNode ast.Node, args ...interface{})

Report an Error with nice printing. The Node which is the Point-of-Failure must be passed.

Example: analysis.Report(pass,"your error message", pointOfFailure)

func ReportWithSuggestedFixes

func ReportWithSuggestedFixes(pass *analysis.Pass, format string, corruptNode ast.Node, suggestedFixes []analysis.SuggestedFix)

ReportWithSuggestedFixes reports an Error with nice printing and suggested fixes. The Node which is the Point-of-Failure must be passed.

Example:

toolbox.ReportWithSuggestedFixes(pass,"your error message %s", pointOfFailure, []analysis.SuggestedFix{
	{
		Message: "make code correct",
		TextEdits: []analysis.TextEdit{
			{
				Pos:     n.Pos(),
				End:     n.End(),
				NewText: []byte("correct Code"),
	 		},
	 	},
	 },
})

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL