From 678f39767e118378ca6cfd53ca8b166979918c71 Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sun, 5 Jul 2020 00:04:47 +0800 Subject: [PATCH] Upgrade golangci-lint and format some code --- .travis.yml | 10 +++++----- ants_test.go | 13 +++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb9ed87..eb88fc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ os: dist: bionic go: - - 1.11.x - - 1.12.x +# - 1.11.x +# - 1.12.x - 1.13.x - 1.14.x @@ -22,7 +22,7 @@ before_install: install: - go get -u golang.org/x/lint/golint - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.26.0 - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ~/bin script: @@ -30,9 +30,9 @@ script: case $TRAVIS_OS_NAME in linux|osx) golint ./... | reviewdog -f=golint -reporter=github-check - golangci-lint run --out-format=line-number -E gofmt -E golint -E misspell -E lll | reviewdog -f=golangci-lint -reporter=github-check + golangci-lint run --out-format=line-number -E goimports -E misspell -E godot -E lll | reviewdog -f=golangci-lint -reporter=github-check golint ./... | reviewdog -f=golint -reporter=github-pr-review - golangci-lint run --out-format=line-number -E gofmt -E golint -E misspell -E lll | reviewdog -f=golangci-lint -reporter=github-pr-review + golangci-lint run --out-format=line-number -E goimports -E misspell -E godot -E lll | reviewdog -f=golangci-lint -reporter=github-pr-review ;; esac - go test -race -coverprofile=coverage.txt -covermode=atomic -v diff --git a/ants_test.go b/ants_test.go index cd74d2d..48c4577 100644 --- a/ants_test.go +++ b/ants_test.go @@ -38,12 +38,12 @@ const ( _ = 1 << (10 * iota) KiB // 1024 MiB // 1048576 - //GiB // 1073741824 - //TiB // 1099511627776 (超过了int32的范围) - //PiB // 1125899906842624 - //EiB // 1152921504606846976 - //ZiB // 1180591620717411303424 (超过了int64的范围) - //YiB // 1208925819614629174706176 + // GiB // 1073741824 + // TiB // 1099511627776 (超过了int32的范围) + // PiB // 1125899906842624 + // EiB // 1152921504606846976 + // ZiB // 1180591620717411303424 (超过了int64的范围) + // YiB // 1208925819614629174706176 ) const ( @@ -192,6 +192,7 @@ func TestAntsPoolWithFuncGetWorkerFromCachePreMalloc(t *testing.T) { //------------------------------------------------------------------------------------------- // Contrast between goroutines without a pool and goroutines with ants pool. //------------------------------------------------------------------------------------------- + func TestNoPool(t *testing.T) { var wg sync.WaitGroup for i := 0; i < n; i++ {