build(golang1.15): Upgrade to golang 1.15 for smaller binary ()

Golang 1.15 comes to few improvements, one of them is to have smaller
binary.

This PR is to make golang 1.15 as default version in CI, I also update
Docker based image to golang:1.15* as well.

Two issues faced with golang 1.15:
- Conflict between -v in `golangci-lint` and `go test`. Update to --verbose
to avoid the same. [1]
- `nolintlint_unused.go` testdata is not matching regex. Correct by adding one
space after //

[1]: https://github.com/golang/go/issues/40763

Signed-off-by: Tam Mach <sayboras@yahoo.com>
This commit is contained in:
Tam Mach 2020-08-19 09:05:32 +10:00 committed by GitHub
parent 6ac41d9f33
commit 18fd36bdd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 10 deletions

View file

@ -26,7 +26,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14 # test only the latest go version to speed up CI
go-version: 1.15 # test only the latest go version to speed up CI
- name: Run tests
run: make.exe test
continue-on-error: true
@ -38,7 +38,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14 # test only the latest go version to speed up CI
go-version: 1.15 # test only the latest go version to speed up CI
- name: Run tests
run: make test
continue-on-error: true
@ -50,6 +50,7 @@ jobs:
golang:
- 1.13
- 1.14
- 1.15
steps:
- uses: actions/checkout@v2
- name: Install Go
@ -77,6 +78,6 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
- name: Check generated files are up to date
run: make fast_check_generated

View file

@ -14,7 +14,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.15
- name: Unshallow
run: git fetch --prune --unshallow
- name: Login do docker.io

View file

@ -1,4 +1,4 @@
FROM golang:1.14
FROM golang:1.15
# don't place it into $GOPATH/bin because Drone mounts $GOPATH as volume
COPY golangci-lint /usr/bin/

View file

@ -1,4 +1,4 @@
FROM golang:1.14-alpine
FROM golang:1.15-alpine
# gcc is required to support cgo;
# git and mercurial are needed most times for go get`, etc.

View file

@ -176,7 +176,7 @@ func TestEnabledLinters(t *testing.T) {
t.Run(c.name, func(t *testing.T) {
t.Parallel()
runArgs := []string{"-v"}
runArgs := []string{"--verbose"}
if !c.noImplicitFast {
runArgs = append(runArgs, "--fast")
}

View file

@ -5,7 +5,7 @@ package testdata
import "fmt"
func Foo() {
fmt.Println("unused") //nolint // ERROR "directive `//nolint .*` is unused"
fmt.Println("unused,specific") //nolint:varcheck // ERROR "directive `//nolint:varcheck .*` is unused for linter varcheck"
fmt.Println("not run") //nolint:unparam // unparam is not run so this is ok
fmt.Println("unused") // nolint // ERROR "directive `//nolint .*` is unused"
fmt.Println("unused,specific") // nolint:varcheck // ERROR "directive `//nolint:varcheck .*` is unused for linter varcheck"
fmt.Println("not run") // nolint:unparam // unparam is not run so this is ok
}