fakeError

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(text string, replaces []Edit) string

Apply 按起始位置从大到小排序,即从后往前替换,避免处理过程中坐标变化 单行:左+新内容+右 多行:前+新内容+后 StartPos:要删除的第一个字符的偏移,这个通过单元测试了,不要改 end:不这样连续替换后没有换行,两个mycheck在一行导致语法错误

func RemoveComments

func RemoveComments(file *ast.File)

func Walk

func Walk(path string, removeComments ...bool)

Types

type Edit

type Edit struct {
	StartPos, EndPos token.Pos
	LineNumber       int

	NewContent string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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