You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopsutil/mktypes.sh

16 lines
403 B
Bash

#!/bin/sh
1 year ago
PKGS="cpu disk docker host load mem net process sensors winservices"
GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
1 year ago
for PKG in $PKGS
do
1 year ago
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