1
0
mirror of https://github.com/osrg/gobgp.git synced 2024-05-11 05:55:10 +00:00
Files
osrg-gobgp/tools/grep_avoided_functions.sh
FUJITA Tomonori c593d7c8b3 switch to Go API v2 for protobuf
seems that sticking to Go API v1 for protobuf is headache for projects
using GoBGP.

This breaks the compatibility so bumps up the major version to 3.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-08 07:22:50 +00:00

30 lines
612 B
Bash
Executable File

#!/usr/bin/env bash
# List of functions which should not be used with remarkable reasons
FUNCS=(
# On a 32-bit platform, int type is not big enough to convert into uint32 type.
# strconv.Atoi() should be replaced by strconv.ParseUint() or
# strconv.ParseInt().
'strconv\.Atoi'
)
SCRIPT_DIR=`dirname $0`
cd "${SCRIPT_DIR}/.."
RESULT=0
PKG_BASE=github.com/osrg/gobgp/v3
for FUNC in ${FUNCS[@]}
do
for GO_PKG in $(go list $PKG_BASE/... | grep -v '/vendor/')
do
grep ${FUNC} -r ${GO_PKG#$PKG_BASE/}
if [ $? -ne 1 ]
then
RESULT=1
fi
done
done
exit $RESULT