Skip to content

Commit

Permalink
build: add golangci-lint and run lint on CI again (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyash authored Mar 23, 2019
1 parent ea9266f commit 55be185
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: go
go:
- 1.9.x
- 1.10.x
- 1.11.x
- 1.12.x
- tip
env:
global:
- GO111MODULE=on
# coveralls token
- secure: Tt++Fdp5IqwJyYuK5EFA29BHGInHxVylFQMRtvpNt2qMZA89Z1N4BUDswqVu23TaMwoFM0a1/E3tAuC0Ffqm19oS8jnFyonuFlXduwG8iVb8znWzP67Jtj9l5xDzra/NhdhE25OxUD3b203rOMChpRx77i+eBITlaYsOMUTq/K77at+NW58qL3W7h6vu4WFBG0T0RbEVjp+IxSJiAUJI9jSYYldo7EpeDL/BqMJeMVe1D0UfVa/DU0GNdDKYibmF+Mag/v34ttlfdYarLEicwQpcQb52NfrRg06iPmiiqRsN/glU2clzkJPLZUmx3UgMPK8nKg4Iu8LXKMCm46UhnnsWcXjnquioLa8vPCv2hoModCcwjGLqC4BHnnh4QqNkMnL3UpLWQcT5zrqvsEIcy1TpwKwOEcIRo1ZqEmgl2kkz5hBN6hjFKR44Uti2ayw831X8FRxyGsq7O6b8R7M4w5gdt12Hj2V04Qnr718ZBhsrbNn+GPPv3p9Pspal9CXvuWTnIRbPCw0DOdajLIX9JMUB86ElPqLGxHBsrc6Ev2rsFPlJZqyur9KBU/KJfmlhrV8veksorugMk6nxshzS0P8eAdbmC+xTo999LQPNZqsNVfbKI97UKkfy7jZxHLDriTBD9qHtJSt+J2wkcS6iGrNe5bEpksZAmxJlSwSqIuY=
before_install:
Expand All @@ -18,6 +18,7 @@ before_script:
- make
script:
- make race
- make lint
- "$HOME/gopath/bin/goveralls -v -service=travis-ci -package=."
notifications:
email:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ gen:

deps:
go get -u golang.org/x/tools/cmd/stringer
go get -u gopkg.in/alecthomas/gometalinter.v1
gometalinter.v1 --install
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0
bin/golangci-lint --version

lint:
gometalinter.v1 ./... --vendor --deadline=1h --dupl-threshold=100 --disable=interfacer --disable=gas
bin/golangci-lint run

test:
go test -v ./...
Expand Down
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ clone_folder: c:\gopath\src\github.com\performancecopilot\speed
environment:
GOPATH: c:\gopath
matrix:
- environment:
GOVERSION: 1.9.7
- environment:
GOVERSION: 1.10.8
- environment:
Expand Down
2 changes: 0 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ func (c *PCPClient) writeHeaderBlock(genc chan int64, g2offc chan int) {
// or deadlock
genc <- gen
g2offc <- g2off

return
}

func (c *PCPClient) writeTocBlock() {
Expand Down
4 changes: 2 additions & 2 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ func (m MetricType) isCompatibleInt(val int) bool {
case Int32Type:
return v >= math.MinInt32 && v <= math.MaxInt32
case Int64Type:
return v >= math.MinInt64 && v <= math.MaxInt64
return true
case Uint32Type:
return v >= 0 && v <= math.MaxUint32
case Uint64Type:
return v >= 0 && uint64(v) <= math.MaxUint64
return v >= 0
}
return false
}
Expand Down
2 changes: 1 addition & 1 deletion mmvdump/mmvdump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestInputs(t *testing.T) {

actual := b.Bytes()

if bytes.Compare(expected, actual) != 0 {
if !bytes.Equal(expected, actual) {
t.Fatalf(`
Failed for input %s,
expected
Expand Down
1 change: 1 addition & 0 deletions speed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func BenchmarkGetHash(b *testing.B) {
}
}

//lint:ignore U1000 keeping for now
type testWriter struct {
message string
t testing.TB
Expand Down

0 comments on commit 55be185

Please sign in to comment.