Bump go version used in build
Signed-off-by: Bob Shannon <bshannon@palantir.com>
This commit is contained in:
parent
5393573c73
commit
e035b26e30
|
@ -2,9 +2,8 @@ sudo: false
|
|||
language: go
|
||||
|
||||
go:
|
||||
- 1.7.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.x
|
||||
|
||||
script:
|
||||
- go test -short ./...
|
||||
|
|
|
@ -20,7 +20,6 @@ package v1
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -147,7 +146,7 @@ type ActiveTarget struct {
|
|||
DiscoveredLabels model.LabelSet `json:"discoveredLabels"`
|
||||
Labels model.LabelSet `json:"labels"`
|
||||
ScrapeURL *url.URL `json:"scrapeUrl"`
|
||||
LastError error `json:"lastError"`
|
||||
LastError string `json:"lastError"`
|
||||
LastScrape time.Time `json:"lastScrape"`
|
||||
Health scrape.TargetHealth `json:"health"`
|
||||
}
|
||||
|
@ -188,11 +187,7 @@ func (a *ActiveTarget) UnmarshalJSON(b []byte) error {
|
|||
a.ScrapeURL = url
|
||||
a.LastScrape = v.LastScrape
|
||||
a.Health = v.Health
|
||||
if v.LastError != "" {
|
||||
a.LastError = errors.New(v.LastError)
|
||||
} else {
|
||||
a.LastError = nil
|
||||
}
|
||||
a.LastError = v.LastError
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ package v1
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
@ -477,7 +476,7 @@ func TestAPIs(t *testing.T) {
|
|||
"job": "prometheus",
|
||||
},
|
||||
ScrapeURL: testURL,
|
||||
LastError: errors.New("error while scraping target"),
|
||||
LastError: "error while scraping target",
|
||||
LastScrape: testTime.Round(0),
|
||||
Health: scrape.HealthGood,
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue