Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from mjtrangoni/fix-gometalinter
Browse files Browse the repository at this point in the history
Fix build issue #34
  • Loading branch information
ofesseler committed Jul 28, 2018
2 parents 4d37e4c + 232e30c commit fdb453f
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Cyclo": 40,
"Deadline": "6m",
"EnableGC": true,
"Exclude": ["Subprocess launching with variable", "Subprocess launched with variable", "Subprocess launching should be audited"],
"Sort": ["linter", "severity", "path", "line"],
"Vendor": true
}
90 changes: 72 additions & 18 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 31 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/prometheus/client_golang"
Expand All @@ -11,3 +32,11 @@
[[constraint]]
branch = "master"
name = "github.com/prometheus/common"

[[constraint]]
name = "gopkg.in/alecthomas/kingpin.v2"
version = "2.2.6"

[prune]
go-tests = true
unused-packages = true
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
PROMU ?= $(GOPATH)/bin/promu
GODEP ?= $(GOPATH)/bin/dep
GOLINTER ?= $(GOPATH)/bin/gometalinter
GOLINTOPS ?= --vendor --deadline=6m --disable=gas --cyclo-over=40
BIN_DIR ?= $(shell pwd):x
TARGET ?= gluster_exporter

Expand Down Expand Up @@ -57,7 +56,7 @@ depcheck: $(GODEP)
gometalinter: $(GOLINTER)
@echo ">> linting code"
@$(GOLINTER) --install > /dev/null
@$(GOLINTER) $(GOLINTOPS) ./...
@$(GOLINTER) --config=./.gometalinter.json ./...

$(GOPATH)/bin/dep dep:
@GOOS=$(shell uname -s | tr A-Z a-z) \
Expand Down
7 changes: 6 additions & 1 deletion gluster_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ func ExecVolumeHealInfo(volumeName string) (int, error) {

for _, brick := range healInfo.HealInfo.Bricks.Brick {
var count int
count, _ = strconv.Atoi(brick.NumberOfEntries)
var err error
count, err = strconv.Atoi(brick.NumberOfEntries)
if err != nil {
log.Error(err)
return -1, err
}
entriesOutOfSync += count
}
return entriesOutOfSync, nil
Expand Down

0 comments on commit fdb453f

Please sign in to comment.