From 95efea901d8f929a02e5342e493c6d906c63fb8d Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Thu, 1 Aug 2019 12:06:50 -0400 Subject: [PATCH] shrink api --- parser/file.go | 14 +++++++------- parser/visitor.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/parser/file.go b/parser/file.go index 8b6a2d8..9ea2bd5 100644 --- a/parser/file.go +++ b/parser/file.go @@ -10,15 +10,15 @@ import ( "github.com/markbates/errx" ) -type ParsedFile struct { +type parsedFile struct { File string FileSet *token.FileSet Ast *ast.File } -// ParseFileMode ... -func ParseFileMode(f string, mode parser.Mode) (ParsedFile, error) { - pf := ParsedFile{ +// parseFileMode ... +func parseFileMode(f string, mode parser.Mode) (parsedFile, error) { + pf := parsedFile{ File: f, FileSet: token.NewFileSet(), } @@ -38,7 +38,7 @@ func ParseFileMode(f string, mode parser.Mode) (ParsedFile, error) { return pf, nil } -// ParseFile ... -func ParseFile(f string) (ParsedFile, error) { - return ParseFileMode(f, 0) +// parseFile ... +func parseFile(f string) (parsedFile, error) { + return parseFileMode(f, 0) } diff --git a/parser/visitor.go b/parser/visitor.go index 4250355..0767465 100644 --- a/parser/visitor.go +++ b/parser/visitor.go @@ -22,7 +22,7 @@ func NewVisitor(p string) (*Visitor, error) { } func (v *Visitor) Run() ([]paths.Path, error) { - pf, err := ParseFile(v.File) + pf, err := parseFile(v.File) if err != nil { return nil, err }