...

Text file src/github.com/shirou/gopsutil/mktypes.sh

Documentation: github.com/shirou/gopsutil

     1#!/bin/sh
     2
     3PKGS="cpu disk docker host load mem net process"
     4
     5GOOS=$(go env GOOS)
     6GOARCH=$(go env GOARCH)
     7GOARCH=$(go env GOARCH)
     8
     9for DIR in . v3
    10do
    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)
    20done

View as plain text