shrink api

This commit is contained in:
Mark Bates 2019-08-01 12:06:50 -04:00
parent 930bae7f01
commit 95efea901d
2 changed files with 8 additions and 8 deletions

View File

@ -10,15 +10,15 @@ import (
"github.com/markbates/errx" "github.com/markbates/errx"
) )
type ParsedFile struct { type parsedFile struct {
File string File string
FileSet *token.FileSet FileSet *token.FileSet
Ast *ast.File Ast *ast.File
} }
// ParseFileMode ... // parseFileMode ...
func ParseFileMode(f string, mode parser.Mode) (ParsedFile, error) { func parseFileMode(f string, mode parser.Mode) (parsedFile, error) {
pf := ParsedFile{ pf := parsedFile{
File: f, File: f,
FileSet: token.NewFileSet(), FileSet: token.NewFileSet(),
} }
@ -38,7 +38,7 @@ func ParseFileMode(f string, mode parser.Mode) (ParsedFile, error) {
return pf, nil return pf, nil
} }
// ParseFile ... // parseFile ...
func ParseFile(f string) (ParsedFile, error) { func parseFile(f string) (parsedFile, error) {
return ParseFileMode(f, 0) return parseFileMode(f, 0)
} }

View File

@ -22,7 +22,7 @@ func NewVisitor(p string) (*Visitor, error) {
} }
func (v *Visitor) Run() ([]paths.Path, error) { func (v *Visitor) Run() ([]paths.Path, error) {
pf, err := ParseFile(v.File) pf, err := parseFile(v.File)
if err != nil { if err != nil {
return nil, err return nil, err
} }