Skip to content

Commit

Permalink
ci: fix typo in vtprotobuf disable logic (#31865)
Browse files Browse the repository at this point in the history
Without this fix, vtprotobuf is accidentally enabled for everyone
instead of just opt-in.

Fixing #31172

Signed-off-by: John Howard <howardjohn@google.com>
  • Loading branch information
howardjohn authored Jan 18, 2024
1 parent f20b6ca commit 948d614
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ case $CI_TARGET in
fi
# TODO(https://github.com/planetscale/vtprotobuf/pull/122) do this directly in the generator.
# Make vtprotobuf opt-in as it has some impact on binary sizes
if [[ "$GO_FILE" = *.vtproto.pb.go ]]; then
sed -i '1s;^;//go:build vtprotobuf\n;' "$OUTPUT_DIR/$(basename "$GO_FILE")"
if [[ "$GO_FILE" = *_vtproto.pb.go ]]; then
if ! grep -q 'package ignore' "$GO_FILE"; then
sed -i '1s;^;//go:build vtprotobuf\n// +build vtprotobuf\n;' "$OUTPUT_DIR/$(basename "$GO_FILE")"
fi
fi
done <<< "$(find "$INPUT_DIR" -name "*.go")"
done
Expand Down

0 comments on commit 948d614

Please sign in to comment.