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

16 lines
403 B
Bash
Raw Permalink Normal View History

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