Skip to content

Commit 3bebfa4

Browse files
author
Stein Fletcher
committed
Add travis config
Automatically applied go fmt
1 parent e272fbb commit 3bebfa4

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: go
2+
3+
go:
4+
- "1.12"
5+
6+
script:
7+
- diff -u <(echo -n) <(gofmt -s -d ./)
8+
- diff -u <(echo -n) <(go vet ./...)
9+
- go test -v ./...
10+
11+
env:
12+
- GO111MODULE=on

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
- 9171
99
ports:
1010
- 9171:9171
11-
image: infinityworks/github-exporter:latest
11+
image: infinityworks/github-exporter:latest
1212
environment:
1313
- REPOS=<REPOS you want to monitor>
1414
- GITHUB_TOKEN=<your github api token>

exporter/gather.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"strconv"
7-
"strings"
7+
"strings"
88

99
log "github.com/sirupsen/logrus"
1010
)
@@ -49,7 +49,6 @@ func (e *Exporter) gatherData() ([]*Datum, *RateLimits, error) {
4949
log.Errorf("Unable to obtain rate limit data from API, Error: %s", err)
5050
}
5151

52-
5352
//return data, rates, err
5453
return data, rates, nil
5554

exporter/http.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ func getResponse(url string, token string, ch chan<- *Response) error {
101101
}
102102
defer resp.Body.Close()
103103

104-
105104
// Read the body to a byte array so it can be used elsewhere
106105
body, err := ioutil.ReadAll(resp.Body)
107106
if err != nil {

exporter/metrics.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package exporter
33
import "github.com/prometheus/client_golang/prometheus"
44
import "strconv"
55

6-
76
// AddMetrics - Add's all of the metrics to a map of strings, returns the map.
87
func AddMetrics() map[string]*prometheus.Desc {
98

exporter/structs.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ type Datum struct {
2828
License struct {
2929
Key string `json:"key"`
3030
} `json:"license"`
31-
Language string `json:"language"`
32-
Archived bool `json:"archived"`
33-
Private bool `json:"private"`
34-
Fork bool `json:"fork"`
35-
Forks float64 `json:"forks"`
36-
Stars float64 `json:"stargazers_count"`
37-
OpenIssues float64 `json:"open_issues"`
38-
Watchers float64 `json:"subscribers_count"`
39-
Size float64 `json:"size"`
31+
Language string `json:"language"`
32+
Archived bool `json:"archived"`
33+
Private bool `json:"private"`
34+
Fork bool `json:"fork"`
35+
Forks float64 `json:"forks"`
36+
Stars float64 `json:"stargazers_count"`
37+
OpenIssues float64 `json:"open_issues"`
38+
Watchers float64 `json:"subscribers_count"`
39+
Size float64 `json:"size"`
4040
Releases []Release
4141
}
4242

0 commit comments

Comments
 (0)