Skip to content

Commit

Permalink
fix issue: #1780: filter $GOROOT path (#1827)
Browse files Browse the repository at this point in the history
Signed-off-by: song <[email protected]>
  • Loading branch information
bobsongplus committed Jun 21, 2024
1 parent 937c239 commit fd2fa83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (pkgDefs *PackagesDefinitions) RangeFiles(handle func(info *AstFileInfo) er
for _, info := range pkgDefs.files {
// ignore package path prefix with 'vendor' or $GOROOT,
// because the router info of api will not be included these files.
if strings.HasPrefix(info.PackagePath, "vendor") || (runtime.GOROOT() != "" && strings.HasPrefix(info.Path, runtime.GOROOT())) {
if strings.HasPrefix(info.PackagePath, "vendor") || (runtime.GOROOT() != "" && strings.HasPrefix(info.Path, runtime.GOROOT()+string(filepath.Separator))) {
continue
}
sortedFiles = append(sortedFiles, info)
Expand Down

0 comments on commit fd2fa83

Please sign in to comment.