diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c095a514d787a3059cb334f3219fda1bd1d22bd4..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go - -go: - - 1.4 - -install: - - go get github.com/digitalocean/rsyslog_exporter - -script: - - make test diff --git a/dyn_stat_test.go b/dyn_stat_test.go index 8d7ff843aeab873032c718105b8a4725a2bfbebf..d96bea5255da2b907196a9297e15b55a3eb24ca4 100644 --- a/dyn_stat_test.go +++ b/dyn_stat_test.go @@ -79,7 +79,7 @@ func TestDynStatToPoints(t *testing.T) { } seen := map[string]bool{} - for name, _ := range wants { + for name := range wants { seen[name] = false } diff --git a/dynafile_cache_test.go b/dynafile_cache_test.go index 970abf6494ad9961dcbc51cda97ea767eacd6dc0..a7cd762ac90e53a27e0f60176742a0f075856a6f 100644 --- a/dynafile_cache_test.go +++ b/dynafile_cache_test.go @@ -104,7 +104,7 @@ func TestDynafileCacheToPoints(t *testing.T) { } seen := map[string]bool{} - for name, _ := range wants { + for name := range wants { seen[name] = false } diff --git a/go.mod b/go.mod index 6090a9c94c41caaa923d9b9446b701e72d1659c9..60075859a0a7ff0b589de13d205102004c349846 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/soundcloud/rsyslog_exporter +module github.com/aleroyer/rsyslog_exporter go 1.13 diff --git a/point.go b/point.go index 499cfc2788014f1b85fcf4d166fbcc56e41c7f89..1f441182587186f24017591c90c506bc963fb67b 100644 --- a/point.go +++ b/point.go @@ -1,7 +1,6 @@ package main import ( - "errors" "fmt" "github.com/prometheus/client_golang/prometheus" @@ -14,11 +13,6 @@ const ( gauge ) -var ( - ErrIncompatiblePointType = errors.New("incompatible point type") - ErrUnknownPointType = errors.New("unknown point type") -) - type point struct { Name string Description string diff --git a/pointstore.go b/pointstore.go index 3da93dfeb75e5cff6318706c4b10a78677ce57c1..632a46bb10945c17cb49c3019c12307f1161c523 100644 --- a/pointstore.go +++ b/pointstore.go @@ -7,7 +7,7 @@ import ( ) var ( - ErrPointNotFound = errors.New("point does not exist") + errPointNotFound = errors.New("point does not exist") ) type pointStore struct { @@ -25,7 +25,7 @@ func newPointStore() *pointStore { func (ps *pointStore) keys() []string { ps.lock.Lock() keys := make([]string, 0) - for k, _ := range ps.pointMap { + for k := range ps.pointMap { keys = append(keys, k) } sort.Strings(keys) @@ -48,5 +48,5 @@ func (ps *pointStore) get(name string) (*point, error) { return p, nil } ps.lock.Unlock() - return &point{}, ErrPointNotFound + return &point{}, errPointNotFound } diff --git a/pointstore_test.go b/pointstore_test.go index ad7afcbff5807eebc69bbeda6d8dbde3cbafba3e..39f09190f56c5d6e77421ca38face5fe7a1ed55f 100644 --- a/pointstore_test.go +++ b/pointstore_test.go @@ -86,7 +86,7 @@ func TestPointStore(t *testing.T) { } _, err = ps.get("no point") - if err != ErrPointNotFound { + if err != errPointNotFound { t.Error("getting non existent point should raise error") } }