Skip to content

Commit

Permalink
Make mktypes.sh generate code for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Lomanic committed Nov 11, 2020
1 parent 7e5409b commit d6f7462
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions mktypes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d6f7462

Please sign in to comment.