1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-28 13:48:49 +08:00
shirou_gopsutil/mktypes.sh

17 lines
407 B
Bash
Raw Normal View History

#!/bin/sh
2014-12-31 00:13:52 +09:00
PKGS="cpu disk docker host load mem net process"
2014-12-31 00:13:52 +09:00
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
GOARCH=$(go env GOARCH)
2014-12-31 00:13:52 +09:00
for PKG in $PKGS
2014-12-31 00:13:52 +09:00
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
2014-12-31 00:13:52 +09:00
done