Fixing tests and CI file

This commit is contained in:
Denis Makogon
2017-07-28 13:32:13 +03:00
parent 49fe3eb11a
commit bb8f12ece9
4 changed files with 9 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ func getTask(ctx context.Context, url string) (*models.Task, error) {
span, _ := opentracing.StartSpanFromContext(ctx, "get_task")
defer span.Finish()
req, _ := http.NewRequest("GET", url, nil)
req, _ := http.NewRequest(http.MethodGet, url, nil)
resp, err := http.DefaultClient.Do(req.WithContext(ctx))
defer func() {
io.Copy(ioutil.Discard, resp.Body)
@@ -37,7 +37,7 @@ func getTask(ctx context.Context, url string) (*models.Task, error) {
return nil, err
}
if resp.StatusCode != http.StatusOK {
return nil, errors.New(fmt.Sprintf("Unable to get task. Reason %v", resp.Status))
return nil, errors.New(fmt.Sprintf("Unable to get task. Reason: %v", resp.Status))
}
var task models.Task