Edit 编辑文件(字符串替换) path: 文件路径 oldStr: 要替换的旧字符串 newStr: 新字符串 replaceAll: true=替换所有匹配, false=仅替换第一个 返回: EditResult,包含替换次数
(ctx context.Context, path, oldStr, newStr string, replaceAll bool)
| 72 | // replaceAll: true=替换所有匹配, false=仅替换第一个 |
| 73 | // 返回: EditResult,包含替换次数 |
| 74 | Edit(ctx context.Context, path, oldStr, newStr string, replaceAll bool) (*EditResult, error) |
| 75 | |
| 76 | // GrepRaw 正则表达式搜索 |
| 77 | // pattern: 正则表达式模式 |
no outgoing calls