Updated sourceinfo

Added packagepathmap to the SourceInfo, this in turn allows the RevelCLI app command to pass the source paths directly to Revel directly
Added default to build to be "target" of the current folder
Renamed source processor
This commit is contained in:
notzippy@gmail.com
2020-04-26 08:58:58 -07:00
parent 3f54665d4e
commit f2b54f5a69
13 changed files with 90 additions and 125 deletions

View File

@@ -7,6 +7,7 @@ import (
"go/ast"
"go/token"
"strings"
"path/filepath"
)
type (
@@ -32,6 +33,8 @@ func (s *SourceInfoProcessor) processPackage(p *packages.Package) (sourceInfo *m
)
for _,tree := range p.Syntax {
for _, decl := range tree.Decls {
s.sourceProcessor.packageMap[p.PkgPath] = filepath.Dir(p.Fset.Position(decl.Pos()).Filename)
//println("*** checking", p.Fset.Position(decl.Pos()).Filename)
spec, found := s.getStructTypeDecl(decl, p.Fset)
if found {
if isController || isTest {