Skip to content

Commit 3649768

Browse files
committed
fix mktypes.sh
1 parent ab7187d commit 3649768

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
run: |
1414
versions=$(curl -s 'https://go.dev/dl/?mode=json' | jq -c 'map(.version[2:])')
1515
echo "::set-output name=value::${versions}"
16-
test_v3_module:
16+
test:
1717
needs: go-versions
1818
strategy:
1919
fail-fast: false

mktypes.sh

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
#!/bin/sh
22

3-
PKGS="cpu disk docker host load mem net process"
3+
PKGS="cpu disk docker host load mem net process sensors winservices"
44

55
GOOS=$(go env GOOS)
66
GOARCH=$(go env GOARCH)
77
GOARCH=$(go env GOARCH)
88

9-
for DIR in .
9+
for PKG in $PKGS
1010
do
11-
(cd "$DIR" || exit
12-
for PKG in $PKGS
13-
do
14-
if [ -e "${PKG}/types_${GOOS}.go" ]; then
15-
(echo "// +build $GOOS"
16-
echo "// +build $GOARCH"
17-
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
18-
fi
19-
done)
11+
if [ -e "${PKG}/types_${GOOS}.go" ]; then
12+
(echo "// +build $GOOS"
13+
echo "// +build $GOARCH"
14+
go tool cgo -godefs "${PKG}/types_${GOOS}.go") | gofmt > "${PKG}/${PKG}_${GOOS}_${GOARCH}.go"
15+
fi
2016
done

0 commit comments

Comments
 (0)