Skip to content
Snippets Groups Projects
Unverified Commit da24f3e6 authored by Antoine Leroyer's avatar Antoine Leroyer
Browse files

Linting, removing non-used variables and removed travis-ci

parent be6c7da8
Branches
No related tags found
No related merge requests found
language: go
go:
- 1.4
install:
- go get github.com/digitalocean/rsyslog_exporter
script:
- make test
...@@ -79,7 +79,7 @@ func TestDynStatToPoints(t *testing.T) { ...@@ -79,7 +79,7 @@ func TestDynStatToPoints(t *testing.T) {
} }
seen := map[string]bool{} seen := map[string]bool{}
for name, _ := range wants { for name := range wants {
seen[name] = false seen[name] = false
} }
......
...@@ -104,7 +104,7 @@ func TestDynafileCacheToPoints(t *testing.T) { ...@@ -104,7 +104,7 @@ func TestDynafileCacheToPoints(t *testing.T) {
} }
seen := map[string]bool{} seen := map[string]bool{}
for name, _ := range wants { for name := range wants {
seen[name] = false seen[name] = false
} }
......
package main package main
import ( import (
"errors"
"fmt" "fmt"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
...@@ -14,11 +13,6 @@ const ( ...@@ -14,11 +13,6 @@ const (
gauge gauge
) )
var (
ErrIncompatiblePointType = errors.New("incompatible point type")
ErrUnknownPointType = errors.New("unknown point type")
)
type point struct { type point struct {
Name string Name string
Description string Description string
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
) )
var ( var (
ErrPointNotFound = errors.New("point does not exist") errPointNotFound = errors.New("point does not exist")
) )
type pointStore struct { type pointStore struct {
...@@ -25,7 +25,7 @@ func newPointStore() *pointStore { ...@@ -25,7 +25,7 @@ func newPointStore() *pointStore {
func (ps *pointStore) keys() []string { func (ps *pointStore) keys() []string {
ps.lock.Lock() ps.lock.Lock()
keys := make([]string, 0) keys := make([]string, 0)
for k, _ := range ps.pointMap { for k := range ps.pointMap {
keys = append(keys, k) keys = append(keys, k)
} }
sort.Strings(keys) sort.Strings(keys)
...@@ -48,5 +48,5 @@ func (ps *pointStore) get(name string) (*point, error) { ...@@ -48,5 +48,5 @@ func (ps *pointStore) get(name string) (*point, error) {
return p, nil return p, nil
} }
ps.lock.Unlock() ps.lock.Unlock()
return &point{}, ErrPointNotFound return &point{}, errPointNotFound
} }
...@@ -86,7 +86,7 @@ func TestPointStore(t *testing.T) { ...@@ -86,7 +86,7 @@ func TestPointStore(t *testing.T) {
} }
_, err = ps.get("no point") _, err = ps.get("no point")
if err != ErrPointNotFound { if err != errPointNotFound {
t.Error("getting non existent point should raise error") t.Error("getting non existent point should raise error")
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment