From 4d61267e690d4feb95afe6d33af49270201eeb1f Mon Sep 17 00:00:00 2001 From: Chris Hines Date: Thu, 19 Aug 2021 21:19:08 -0400 Subject: [PATCH 1/4] Add Go 1.17 to build matrix --- .github/workflows/test.yml | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7dc1486..a3a3e91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,34 +4,34 @@ jobs: test: strategy: matrix: - go-version: [1.16.x] + go-version: [1.16.x, 1.17.x] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v1 - with: - go-version: ${{ matrix.go-version }} - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest - shell: bash - - name: Install golint - run: go install golang.org/x/lint/golint@latest - shell: bash - - name: Update PATH - run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - shell: bash - - name: Checkout code - uses: actions/checkout@v1 - - name: Fmt - if: matrix.platform != 'windows-latest' # :( - run: "diff <(gofmt -d .) <(printf '')" - shell: bash - - name: Vet - run: go vet ./... - - name: Staticcheck - run: staticcheck ./... - - name: Lint - run: golint ./... - - name: Test - run: go test -race ./... + - name: Install Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version }} + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + shell: bash + - name: Install golint + run: go install golang.org/x/lint/golint@latest + shell: bash + - name: Update PATH + run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + shell: bash + - name: Checkout code + uses: actions/checkout@v1 + - name: Fmt + if: matrix.platform != 'windows-latest' # :( + run: "diff <(gofmt -d .) <(printf '')" + shell: bash + - name: Vet + run: go vet ./... + - name: Staticcheck + run: staticcheck ./... + - name: Lint + run: golint ./... + - name: Test + run: go test -race ./... From 4b2778bb25b0fd5db3682f6a1dfc1774616cd879 Mon Sep 17 00:00:00 2001 From: Chris Hines Date: Thu, 19 Aug 2021 21:25:15 -0400 Subject: [PATCH 2/4] Update dependencies --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 7c87949..a53f051 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/go-kit/log -go 1.16 +go 1.17 require ( - github.com/go-logfmt/logfmt v0.5.0 - github.com/go-stack/stack v1.8.0 + github.com/go-logfmt/logfmt v0.5.1 + github.com/go-stack/stack v1.8.1 ) diff --git a/go.sum b/go.sum index 59a7cf6..048a855 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= From ab190997aa9fa48e7b0ea628298c7e091765cffb Mon Sep 17 00:00:00 2001 From: Chris Hines Date: Thu, 19 Aug 2021 21:32:54 -0400 Subject: [PATCH 3/4] go fmt ./... --- syslog/example_test.go | 5 ++--- syslog/syslog.go | 5 ++--- syslog/syslog_test.go | 5 ++--- term/colorwriter_others.go | 1 + term/terminal_linux.go | 1 + term/terminal_notwindows.go | 1 + term/terminal_stub.go | 1 + term/terminal_windows.go | 1 + 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/syslog/example_test.go b/syslog/example_test.go index ed6b9e4..03647fd 100644 --- a/syslog/example_test.go +++ b/syslog/example_test.go @@ -1,6 +1,5 @@ -// +build !windows -// +build !plan9 -// +build !nacl +//go:build !windows && !plan9 && !nacl +// +build !windows,!plan9,!nacl package syslog_test diff --git a/syslog/syslog.go b/syslog/syslog.go index bcb3026..aff954c 100644 --- a/syslog/syslog.go +++ b/syslog/syslog.go @@ -1,6 +1,5 @@ -// +build !windows -// +build !plan9 -// +build !nacl +//go:build !windows && !plan9 && !nacl +// +build !windows,!plan9,!nacl package syslog diff --git a/syslog/syslog_test.go b/syslog/syslog_test.go index 732401e..7717f2d 100644 --- a/syslog/syslog_test.go +++ b/syslog/syslog_test.go @@ -1,6 +1,5 @@ -// +build !windows -// +build !plan9 -// +build !nacl +//go:build !windows && !plan9 && !nacl +// +build !windows,!plan9,!nacl package syslog diff --git a/term/colorwriter_others.go b/term/colorwriter_others.go index cc57102..c427270 100644 --- a/term/colorwriter_others.go +++ b/term/colorwriter_others.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package term diff --git a/term/terminal_linux.go b/term/terminal_linux.go index ffeab4d..5a31516 100644 --- a/term/terminal_linux.go +++ b/term/terminal_linux.go @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !appengine // +build !appengine package term diff --git a/term/terminal_notwindows.go b/term/terminal_notwindows.go index 9c72558..ef8f5a2 100644 --- a/term/terminal_notwindows.go +++ b/term/terminal_notwindows.go @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build (linux && !appengine) || darwin || freebsd || openbsd // +build linux,!appengine darwin freebsd openbsd package term diff --git a/term/terminal_stub.go b/term/terminal_stub.go index 7c3e64b..f94f1ea 100644 --- a/term/terminal_stub.go +++ b/term/terminal_stub.go @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build appengine || js // +build appengine js package term diff --git a/term/terminal_windows.go b/term/terminal_windows.go index 4b10e50..17c9b85 100644 --- a/term/terminal_windows.go +++ b/term/terminal_windows.go @@ -3,6 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build windows // +build windows package term From 897ff71a2bae372abf2bd8d0ea1fe67deff5560e Mon Sep 17 00:00:00 2001 From: Chris Hines Date: Thu, 19 Aug 2021 21:39:05 -0400 Subject: [PATCH 4/4] Run all matrix builds even if one fails --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3a3e91..e3a1200 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,7 @@ name: Test jobs: test: strategy: + fail-fast: false matrix: go-version: [1.16.x, 1.17.x] platform: [ubuntu-latest, macos-latest, windows-latest]