From 0a719ffa21110b6234c428eb99e7abb071bae58c Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 22 Sep 2020 14:52:42 +1000 Subject: [PATCH 1/3] add base CI setup for actions --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..769aa71 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,29 @@ +on: [push, pull_request] +name: Test +env: + GOPROXY: "https://proxy.golang.org" +jobs: + test: + strategy: + matrix: + go-version: [1.14.x, 1.15.x] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Format + run: gofmt -d . + - name: Lint + if: matrix.os != 'windows-latest' + run: | + go get -v -u golang.org/x/lint/golint + $(go env GOPATH)/bin/golint -set_exit_status . + - name: Vet + run: go vet $(go list ./... | grep -v /vendor/) + - name: Test + run: go test -v -race ./... From d83a825290506f705ac58e40b9e8bcf8e46a2469 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 22 Sep 2020 14:56:53 +1000 Subject: [PATCH 2/3] use correct error wrapping directive --- cmd/exec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/exec.go b/cmd/exec.go index be8119c..d5fa9a9 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -102,7 +102,7 @@ var execCmd = &cobra.Command{ executable := args[0] pathtoExec, err := exec.LookPath(executable) if err != nil { - log.Fatalf("couldn't find the executable '%s': %w", pathtoExec, err) + log.Fatalf("couldn't find the executable '%s': %s", pathtoExec, err.Error()) } log.Debugf("found executable %s", pathtoExec) From e7d8ee9ea4b9403a8748b8bc93c2c7156e03f8c9 Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Tue, 22 Sep 2020 14:58:10 +1000 Subject: [PATCH 3/3] don't bother ignoring vendor, we don't use it --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 769aa71..6aa257e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,6 @@ jobs: go get -v -u golang.org/x/lint/golint $(go env GOPATH)/bin/golint -set_exit_status . - name: Vet - run: go vet $(go list ./... | grep -v /vendor/) + run: go vet - name: Test run: go test -v -race ./...