Bump go version used in build

Signed-off-by: Bob Shannon <bshannon@palantir.com>
This commit is contained in:
Bob Shannon 2018-04-10 18:37:17 -07:00
parent 5393573c73
commit e035b26e30
3 changed files with 5 additions and 12 deletions

View File

@ -2,9 +2,8 @@ sudo: false
language: go language: go
go: go:
- 1.7.x - 1.10.x
- 1.8.x - 1.x
- 1.9.x
script: script:
- go test -short ./... - go test -short ./...

View File

@ -20,7 +20,6 @@ package v1
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"net/http" "net/http"
"net/url" "net/url"
@ -147,7 +146,7 @@ type ActiveTarget struct {
DiscoveredLabels model.LabelSet `json:"discoveredLabels"` DiscoveredLabels model.LabelSet `json:"discoveredLabels"`
Labels model.LabelSet `json:"labels"` Labels model.LabelSet `json:"labels"`
ScrapeURL *url.URL `json:"scrapeUrl"` ScrapeURL *url.URL `json:"scrapeUrl"`
LastError error `json:"lastError"` LastError string `json:"lastError"`
LastScrape time.Time `json:"lastScrape"` LastScrape time.Time `json:"lastScrape"`
Health scrape.TargetHealth `json:"health"` Health scrape.TargetHealth `json:"health"`
} }
@ -188,11 +187,7 @@ func (a *ActiveTarget) UnmarshalJSON(b []byte) error {
a.ScrapeURL = url a.ScrapeURL = url
a.LastScrape = v.LastScrape a.LastScrape = v.LastScrape
a.Health = v.Health a.Health = v.Health
if v.LastError != "" { a.LastError = v.LastError
a.LastError = errors.New(v.LastError)
} else {
a.LastError = nil
}
return err return err
} }

View File

@ -18,7 +18,6 @@ package v1
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"net/http" "net/http"
"net/url" "net/url"
@ -477,7 +476,7 @@ func TestAPIs(t *testing.T) {
"job": "prometheus", "job": "prometheus",
}, },
ScrapeURL: testURL, ScrapeURL: testURL,
LastError: errors.New("error while scraping target"), LastError: "error while scraping target",
LastScrape: testTime.Round(0), LastScrape: testTime.Round(0),
Health: scrape.HealthGood, Health: scrape.HealthGood,
}, },