Skip to content

Commit

Permalink
Add more well-known types: Struct, Timestamp and Wrappers.
Browse files Browse the repository at this point in the history
Updates #50.
  • Loading branch information
dsymonds committed Feb 11, 2016
1 parent 8ea33d2 commit 0dfe8f3
Show file tree
Hide file tree
Showing 7 changed files with 1,008 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types/regen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ PROTO_FILES='
any.proto
duration.proto
empty.proto
struct.proto
timestamp.proto
wrappers.proto
'

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

Expand Down
Loading

0 comments on commit 0dfe8f3

Please sign in to comment.