You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/03/18 20:08:56 UTC

[GitHub] [beam] lostluck commented on a change in pull request #16961: BEAM-13939: Restructure Protos to fix namespace conflicts

lostluck commented on a change in pull request #16961:
URL: https://github.com/apache/beam/pull/16961#discussion_r830311698



##########
File path: sdks/go/scripts/genmodel.sh
##########
@@ -0,0 +1,81 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+if [[ -z "$(which protoc)" ]]; then
+  echo "protoc not found on path"
+  exit 1
+fi
+
+SCRIPT_DIR="$( realpath "$( dirname "${BASH_SOURCE[0]}" )" )"
+if [[ -z $SCRIPT_DIR ]]; then
+  echo "unable to resolve path to script"
+  exit 1
+fi
+
+PROJECT_ROOT="$(realpath "$(dirname $SCRIPT_DIR)/../..")"
+if [[ -z "$PROJECT_ROOT" ]]; then
+  echo "unable to resolve path to project root"
+  exit 1
+fi
+
+if [[ -z "$(which go)" ]]; then
+  echo "go runtime missing"
+  exit 1
+fi
+
+if [[ -z "$GOPATH" ]]; then
+  export GOPATH="$(go env GOPATH)"

Review comment:
       You may be able to avoid specifying GOPATH (which is unnecessary in recent Go releases), and then we shouldn't need to keep the proto packages independantly in sync with the mod file versions. It should be automaticly picking it up since it's "under" the module directory.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org