1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 10:00:50 +00:00

Fix: docs generator skips everything containing 'vendor' in path which is wrong. Fixed that to skip only the 'vendor' dir directly under the project root. Also don't even scan a dir beginning with a '.'.

This commit is contained in:
Vladimir Alaev 2017-07-12 17:23:53 +03:00
parent 9e4a43f08a
commit 416fb2ec9d

View File

@ -104,7 +104,11 @@ func ParsePackagesFromDir(dirpath string) {
return nil
}
if !strings.Contains(fpath, "vendor") && !strings.Contains(fpath, "tests") {
// 7 is length of 'vendor' (6) + length of file path separator (1)
// so we skip dir 'vendor' which is directly under dirpath
if !(len(fpath) == len(dirpath)+7 && strings.HasSuffix(fpath, "vendor")) &&
!strings.Contains(fpath, "tests") &&
!(len(fpath) > len(dirpath) && fpath[len(dirpath)+1] == '.') {
err = parsePackageFromDir(fpath)
if err != nil {
// Send the error to through the channel and continue walking