Skip to content

Commit 0dfe8f3

Browse files
committed
Add more well-known types: Struct, Timestamp and Wrappers.
Updates #50.
1 parent 8ea33d2 commit 0dfe8f3

File tree

7 files changed

+1008
-1
lines changed

7 files changed

+1008
-1
lines changed

types/regen.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ PROTO_FILES='
1212
any.proto
1313
duration.proto
1414
empty.proto
15+
struct.proto
16+
timestamp.proto
17+
wrappers.proto
1518
'
1619

1720
function die() {
@@ -41,7 +44,7 @@ git clone -q $UPSTREAM $tmpdir
4144
declare -A filename_map
4245
for f in $(cd $PKG && find * -name '*.proto'); do
4346
echo -n 1>&2 "looking for latest version of $f... "
44-
up=$(cd $tmpdir/$UPSTREAM_SUBDIR && find * -name $(basename $f))
47+
up=$(cd $tmpdir/$UPSTREAM_SUBDIR && find * -name $(basename $f) | grep -v /testdata/)
4548
echo 1>&2 $up
4649
if [ $(echo $up | wc -w) != "1" ]; then
4750
die "not exactly one match"
@@ -56,6 +59,8 @@ for up in "${!filename_map[@]}"; do
5659
# Adjust proto package.
5760
# TODO(dsymonds): Upstream the go_package option instead.
5861
sed '/^package /a option go_package = "'${shortname}'";' |
62+
# Unfortunately "package struct" doesn't work.
63+
sed '/option go_package/s,"struct","structpb",' |
5964
cat > $PKG/$f
6065
done
6166

0 commit comments

Comments
 (0)