annotation

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(length int) string

Create generates the text of a comment that will annotate long lines.

func Has

func Has[T dst.Node](node T) bool

Has determines whether the given AST node has a line length annotation on it.

func HasRecursive

func HasRecursive[T dst.Node](node T) bool

HasRecursive determines whether the given node or one of its children has a golines annotation on it. It's currently implemented for function declarations, fields, call expressions, and selector expressions only.

func HasTail

func HasTail(node dst.Node) bool

HasTail determines whether the given AST node has a line length annotation at its end. This is needed to catch long function declarations with inline interface definitions.

func Is

func Is(line string) bool

Is determines whether the given line is an annotation created with Create.

func Parse

func Parse(line string) int

Parse returns the line length encoded in a golines annotation. If none is found, it returns -1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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