model.go 394 B

123456789101112131415161718192021222324
  1. package main
  2. import (
  3. "fmt"
  4. "go/ast"
  5. "strings"
  6. )
  7. type lint struct {
  8. s *script
  9. fn func(curDir string, f *ast.File, node ast.Node) bool
  10. }
  11. type script struct {
  12. dir string
  13. ts []string // type slice
  14. v string
  15. l string
  16. d string
  17. }
  18. func (s script) String() string {
  19. return fmt.Sprintf("script path: %s, type: %s, value: %s, level: %s", s.dir, strings.Join(s.ts, "."), s.v, s.l)
  20. }