Update to use the latest protobuf package to build pb (#5193)

* Update to use the latest protobuf package to build pb

The pb package was generated some time ago with old version
of https://github.com/golang/protobuf which was deprecated
and in favor of google.golang.org/protobuf (see
deprecation notice in https://pkg.go.dev/github.com/golang/protobuf)

This PR updates the generation of pb package with
v1.27.1 of google.golang.org/protobuf.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Exclude pb from import test

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2022-02-17 23:11:45 -08:00
committed by GitHub
parent c0c72e5894
commit 2f020dcb30
6 changed files with 236 additions and 128 deletions

View File

@@ -250,6 +250,10 @@ func (w *testImportOrderingWalker) walk(path string, info os.FileInfo, _ error)
if filepath.Ext(path) != ".go" {
return nil
}
// pb files are autogenerated by protoc
if strings.HasPrefix(path, "../pb/") {
return nil
}
fs := token.NewFileSet()
f, err := parser.ParseFile(fs, path, nil, parser.AllErrors)