package astutil
import "golang.org/x/tools/internal/astutil"
Index ¶
- func CloneNode[T ast.Node](n T) T
- func Deprecation(doc *ast.CommentGroup) string
- func PosInStringLiteral(lit *ast.BasicLit, offset int) (token.Pos, error)
- func RangeInStringLiteral(lit *ast.BasicLit, start, end int) (token.Pos, token.Pos, error)
Functions ¶
func CloneNode ¶
CloneNode returns a deep copy of a Node. It omits pointers to ast.{Scope,Object} variables.
func Deprecation ¶
func Deprecation(doc *ast.CommentGroup) string
Deprecation returns the paragraph of the doc comment that starts with the conventional "Deprecation: " marker, as defined by https://go.dev/wiki/Deprecated, or "" if the documented symbol is not deprecated.
func PosInStringLiteral ¶
PosInStringLiteral returns the position within a string literal corresponding to the specified byte offset within the logical string that it denotes.
func RangeInStringLiteral ¶
RangeInStringLiteral calculates the positional range within a string literal corresponding to the specified start and end byte offsets within the logical string.
Source Files ¶
clone.go comment.go util.go
Directories ¶
Path | Synopsis |
---|---|
internal/astutil/cursor | Package cursor augments inspector.Inspector with Cursor functionality allowing more flexibility and control during inspection. |
internal/astutil/edge | Package edge defines identifiers for each field of an ast.Node struct type that refers to another Node. |
- Version
- v0.30.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 8 hours ago –
Tools for package owners.