regen-gapic: export SetGoogleClientInfo in places that need it

This is a no-op with the monolithic generator but microgenerator will need this to work.

The (S|s)etGoogleClientInfo function is meant to be used only by manual
cloud clients to add version information. If the API has no manual
clients, exporting the function adds unnecessary clutter and confusion.

In the monolithic generator, we have the "domain_layer_location" GAPIC config (the
name is rather cryptic and I cannot recall its origin) that points to
the manual client. The generator has the logic to export the function if
and only if the config is not empty.

Now that microgenerators read only the proto annotations and not GAPIC
config, we don't have access to domain_layer_location anymore, but we
still don't want to unconditionally export this function. Thus, this CL
adds a small tool to post-process.

Change-Id: I9e275c594d1e0ef86a9c7d01eb75dd36a6fe8a4d
Reviewed-by: kokoro <>
Reviewed-by: Jean de Klerk <>
diff --git a/ b/
index ba06c0f..438d0e8 100755
--- a/
+++ b/
@@ -84,11 +84,20 @@
     find . -path "*/$dir/doc.go" -exec sed -i.backup -e "s/^const versionClient.*/const versionClient = \"$ver\"/" '{}' +
-  find $GOPATH/src/ -name '*.backup' -delete
-#go list | grep apiv | xargs go test
-#go test -short
+for dir in "${HASMANUAL[@]}"; do
+	find "$GOPATH/src/$dir" -name '*.go' -exec sed -i.backup -e 's/setGoogleClientInfo/SetGoogleClientInfo/g' '{}' '+'
-#echo "googleapis version: $(git rev-parse HEAD)"
+find $GOPATH/src/ -name '*.backup' -delete