Merge branch 'master' into static-interface-check
This commit is contained in:
commit
5b2282d8e5
@ -10,6 +10,7 @@ import (
|
||||
"go/token"
|
||||
"go/types"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
@ -238,7 +239,19 @@ func pkgInfoFromPath(src string) (*loader.PackageInfo, error) {
|
||||
ParserMode: parser.SpuriousErrors,
|
||||
Cwd: src,
|
||||
}
|
||||
conf.Import(pkgFull)
|
||||
if strings.HasPrefix(pkgFull, string(filepath.Separator)) {
|
||||
files, err := ioutil.ReadDir(pkgFull)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, file := range files {
|
||||
if !file.IsDir() && strings.HasSuffix(file.Name(), ".go") && !strings.HasSuffix(file.Name(), "_test.go") {
|
||||
conf.CreateFromFilenames(abs, file.Name())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
conf.Import(pkgFull)
|
||||
}
|
||||
lprog, err := conf.Load()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user