modify

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 18 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConfig

func AddConfig(name, expression string) modify.Action

AddConfig adds a configuration key with the given expression to the config file.

func AddImport

func AddImport(path string, name ...string) modify.Action

AddImport adds an import statement to the file.

func ExprExists

func ExprExists(x []dst.Expr, y dst.Expr) bool

func ExprIndex

func ExprIndex(x []dst.Expr, y dst.Expr) int

func File

func File(path string) modify.File

func GoFile

func GoFile(file string) modify.GoFile

func IsUsingImport

func IsUsingImport(df *dst.File, path string, name ...string) bool

func KeyExists

func KeyExists(kvs []dst.Expr, key dst.Expr) bool

func KeyIndex

func KeyIndex(kvs []dst.Expr, key dst.Expr) int

func MustParseExpr

func MustParseExpr(x string) (node dst.Node)

func Register

func Register(expression string, before ...string) modify.Action

Register adds a registration to the matched specified array.

func RemoveConfig

func RemoveConfig(name string) modify.Action

RemoveConfig removes a configuration key from the config file.

func RemoveImport

func RemoveImport(path string, name ...string) modify.Action

RemoveImport removes an import statement from the file.

func ReplaceConfig

func ReplaceConfig(name, expression string) modify.Action

ReplaceConfig replaces a configuration key with the given expression in the config file.

func Unregister

func Unregister(expression string) modify.Action

Unregister remove a registration from the matched specified array.

func WhenFacade

func WhenFacade(facade string, applies ...modify.Apply) modify.Apply

func WhenNoFacades

func WhenNoFacades(facades []string, applies ...modify.Apply) modify.Apply

func WrapNewline

func WrapNewline[T dst.Node](node T) T

Types

This section is empty.

Jump to

Keyboard shortcuts

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