-
Notifications
You must be signed in to change notification settings - Fork 73
Description
I believe https://github.com/hyperledger/fabric-protos-go is deprecated, and https://github.com/hyperledger/fabric-protos-go-apiv2 is the latest fabric-protos-go package.
Hence this needs to be updated in all .proto definitions as:
option go_package = "github.com/hyperledger/fabric-protos-go-apiv2";
This is so that if some other's project's .proto depends upon fabric-protos, then on compiling it created dependency to deprecated version i.e. github.com/hyperledger/fabric-protos-go, which then later on create conflicts with go applications depending on this proto and fabric-protos.
I'm a maintainer/co-owner of Hyperledger/Cacti, where we are facing this issue.
I've a bash script to do this (which is what I'm using for workaround), if you are okay with it, I can create PR for this.
script:
Script
#!/bin/bash
ROOT_DIR=${1:-'..'}
pushd $ROOT_DIR
files=$(find ./fabric-protos -name *.proto)
for filename in $files
do
sed -i'.scriptbak' -e ' s#^option go_package = "github.com/hyperledger/fabric-protos-go/#option go_package = "github.com/hyperledger/fabric-protos-go-apiv2/#' "$filename"
rm -rf $filename.scriptbak
cat $filename | grep "option go_package"
done
popd $ROOT_DIR