Skip to content

Go script to run troubleshooting commands without creating large logs

License

Notifications You must be signed in to change notification settings

mchirico/go_script

Repository files navigation

Build Status Maintainability Test Coverage codecov Go Report Card

go_script

Trouble shooting bash script, managed by go.

Libraries Necessary

go get github.com/prometheus/client_golang/prometheus
go get github.com/prometheus/client_golang/prometheus/promauto
go get github.com/prometheus/client_golang/prometheus/promhttp
go get -u github.com/gorilla/mux
go get gopkg.in/yaml.v2

Build

mkdir -p scratch && cd scratch
git clone https://github.com/mchirico/go_script.git
cd go_script
go mod init 


go build ./cmd/script

# Yes, run this twice to create script file.
./script
./script

# Want to run tests?

go build ./...
go test ./...

Build with vendor

mkdir -p scratch && cd scratch
git clone https://github.com/mchirico/go_script.git
cd go_script

export GO111MODULE=on
go mod init
# Below will put all packages in a vendor folder
go mod vendor



go test -v -mod=vendor ./...

# Don't forget the "." in "./cmd/script" below
go build -v -mod=vendor ./cmd/script


Build for Linux on a Mac

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
go build -o scriptLinux github.com/mchirico/go_script/cmd/script

Table of Values

$GOOS     $GOARCH
darwin    386      – 32 bit MacOSX
darwin    amd64    – 64 bit MacOSX
freebsd   386
freebsd   amd64
linux     386      – 32 bit Linux
linux     amd64    – 64 bit Linux
linux     arm      – RISC Linux
netbsd    386
netbsd    amd64
openbsd   386
openbsd   amd64
plan9     386
windows   386      – 32 bit Windows
windows   amd64    – 64 bit Windows

About

Go script to run troubleshooting commands without creating large logs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published