Make mktypes.sh generate code for v3

This commit is contained in:
Lomanic 2020-11-11 22:58:39 +01:00
parent 7e5409b131
commit d6f7462429
1 changed files with 10 additions and 6 deletions

View File

@ -6,11 +6,15 @@ GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
GOARCH=$(go env GOARCH)
for PKG in $PKGS
for DIR in . v3
do
if [ -e "${PKG}/types_${GOOS}.go" ]; then
(echo "// +build $GOOS"
echo "// +build $GOARCH"
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
fi
(cd "$DIR" || exit
for PKG in $PKGS
do
if [ -e "${PKG}/types_${GOOS}.go" ]; then
(echo "// +build $GOOS"
echo "// +build $GOARCH"
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
fi
done)
done