Skip to content

Commit

Permalink
fix mktypes.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Feb 17, 2024
1 parent ab7187d commit 3649768
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run: |
versions=$(curl -s 'https://go.dev/dl/?mode=json' | jq -c 'map(.version[2:])')
echo "::set-output name=value::${versions}"
test_v3_module:
test:
needs: go-versions
strategy:
fail-fast: false
Expand Down
18 changes: 7 additions & 11 deletions mktypes.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#!/bin/sh

PKGS="cpu disk docker host load mem net process"
PKGS="cpu disk docker host load mem net process sensors winservices"

GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
GOARCH=$(go env GOARCH)

for DIR in .
for PKG in $PKGS
do
(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)
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

0 comments on commit 3649768

Please sign in to comment.