Update go dependencies

This commit is contained in:
Manuel de Brito Fontes 2018-07-12 13:19:04 -04:00 committed by Manuel Alejandro de Brito Fontes
parent d5cf22c129
commit 063cc68d1c
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
1321 changed files with 52830 additions and 31081 deletions

View file

@ -73,14 +73,14 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// be used directly after any stripping needed for security/privacy reasons.
type Status struct {
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
// A developer-facing error message, which should be in English. Any
// user-facing error message should be localized and sent in the
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// A list of messages that carry the error details. There is a common set of
// message types for APIs to use.
Details []*any.Any `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"`
Details []*any.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`

View file

@ -21,6 +21,9 @@
// If the pkg_prefix flag is not an empty string,
// any proto file without `go_package` option
// or whose option does not begin with the prefix is ignored.
// If multiple roots contain files with the same name,
// eg "root1/path/to/file" and "root2/path/to/file",
// only the first file is processed; the rest are ignored.
// Protoc is executed on remaining files,
// one invocation per set of files declaring the same Go package.
package main
@ -58,22 +61,33 @@ func main() {
log.Fatal("need go_out flag")
}
seenFiles := make(map[string]bool)
pkgFiles := make(map[string][]string)
walkFn := func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.Mode().IsRegular() || !strings.HasSuffix(path, ".proto") {
for _, root := range flag.Args() {
walkFn := func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.Mode().IsRegular() || !strings.HasSuffix(path, ".proto") {
return nil
}
switch rel, err := filepath.Rel(root, path); {
case err != nil:
return err
case seenFiles[rel]:
return nil
default:
seenFiles[rel] = true
}
pkg, err := goPkg(path)
if err != nil {
return err
}
pkgFiles[pkg] = append(pkgFiles[pkg], path)
return nil
}
pkg, err := goPkg(path)
if err != nil {
return err
}
pkgFiles[pkg] = append(pkgFiles[pkg], path)
return nil
}
for _, root := range flag.Args() {
if err := filepath.Walk(root, walkFn); err != nil {
log.Fatal(err)
}

View file

@ -24,7 +24,8 @@ set -e
PKG=google.golang.org/genproto
PROTO_REPO=https://github.com/google/protobuf
PROTO_SUBDIR=src/google/protobuf
API_REPO=https://github.com/googleapis/googleapis
GOOGLEAPIS_REPO=https://github.com/googleapis/googleapis
API_COMMON_REPO=https://github.com/googleapis/api-common-protos.git
function die() {
echo 1>&2 $*
@ -57,18 +58,26 @@ fi
if [ -z "$GOOGLEAPIS" ]; then
apidir=$(mktemp -d -t regen-cds-api.XXXXXX)
git clone -q $API_REPO $apidir &
git clone -q $GOOGLEAPIS_REPO $apidir &
remove_dirs="$remove_dirs $apidir"
else
apidir="$GOOGLEAPIS"
fi
if [ -z "$COMMONPROTOS" ]; then
commondir=$(mktemp -d -t regen-cds-common.XXXXXX)
git clone -q $API_COMMON_REPO $commondir &
remove_dirs="$remove_dirs $commondir"
else
commondir="$COMMONPROTOS"
fi
wait
# Nuke everything, we'll generate them back
rm -r googleapis/ protobuf/
go run regen.go -go_out "$root/src" -pkg_prefix "$PKG" "$apidir" "$protodir"
go run regen.go -go_out "$root/src" -pkg_prefix "$PKG" "$commondir" "$apidir" "$protodir"
# Sanity check the build.
echo 1>&2 "Checking that the libraries build..."