Merge branch 'master' of github.com:lu4p/garble

pull/22/head
lu4p 5 years ago
commit 97bee3e943

@ -286,13 +286,10 @@ func transformCompile(args []string) ([]string, error) {
return nil, err
}
// log.Printf("%#v", ids)
var files []*ast.File
for _, path := range paths {
file, err := parser.ParseFile(fset, path, nil, parser.ParseComments)
if err != nil {
return nil, err
}
files = append(files, file)
files, err := parseFilesFromPaths(paths)
if err != nil {
return nil, err
}
info := &types.Info{
@ -695,3 +692,15 @@ func flagSetValue(flags []string, name, value string) []string {
}
return append(flags, name+"="+value)
}
func parseFilesFromPaths(paths []string) (files []*ast.File, err error) {
for _, path := range paths {
file, err := parser.ParseFile(fset, path, nil, parser.ParseComments)
if err != nil {
return nil, err
}
files = append(files, file)
}
return
}

@ -70,4 +70,4 @@ type ImportedType int
type ImportedAPI int
var _ = reflect.TypeOf(ImportedAPI(0))
var _ = reflect.TypeOf(ImportedAPI(0))

Loading…
Cancel
Save