interfaces.go 362 B

1234567891011121314151617
  1. package ast
  2. import (
  3. "go/ast"
  4. "io"
  5. )
  6. type Ast interface {
  7. // Parse 解析文件/代码
  8. Parse(filename string, writer io.Writer) (file *ast.File, err error)
  9. // Rollback 回滚
  10. Rollback(file *ast.File) error
  11. // Injection 注入
  12. Injection(file *ast.File) error
  13. // Format 格式化输出
  14. Format(filename string, writer io.Writer, file *ast.File) error
  15. }