Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeprecatedFunc ¶
type DeprecatedFunc struct { Package string Function string Alternative string Start token.Position End token.Position }
DeprecatedFunc represents a deprecated function
type DeprecatedFuncChecker ¶
type DeprecatedFuncChecker struct {
// contains filtered or unexported fields
}
DeprecatedFuncChecker checks for deprecated functions
func NewDeprecatedFuncChecker ¶
func NewDeprecatedFuncChecker() *DeprecatedFuncChecker
NewDeprecatedFuncChecker creates a new DeprecatedFuncChecker
func (*DeprecatedFuncChecker) Check ¶
func (d *DeprecatedFuncChecker) Check(filename string, node *ast.File, fset *token.FileSet) ([]DeprecatedFunc, error)
Check checks an AST node for deprecated functions
func (*DeprecatedFuncChecker) Register ¶
func (d *DeprecatedFuncChecker) Register(pkgName, funcName, alternative string)
Register adds a deprecated function to the checker
@notJoon 10/08/2024: The deprecated functions are currently beign updated manually in the internal/lints/deprecate_func.go file. We could consider automatically recognizing and updating the map if the comments include the string `Deprecated:` in accordance with the `godoc` style.
However, this approach would require additional file traversal, which I believe would be mostly unnecessary computation and may not be worth the effort.
Therefore, currently, it seems more efficient to manually update the deprecated functions to only handle the deprecated items in gno's standard library.
type PkgFuncMap ¶
PkgFuncMap maps package paths to function names and their alternatives