Fix lints
This commit is contained in:
parent
0f7fcaffdb
commit
5a03c74642
@ -15,7 +15,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Timing struct {
|
type Timing struct {
|
||||||
TimeMillis time.Duration `json:"timeMillis"`
|
ExecutionTime time.Duration `json:"executionTime"`
|
||||||
Source string `json:"source"`
|
Source string `json:"source"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ func (app *Application) HealthCheck(w http.ResponseWriter, r *http.Request) {
|
|||||||
Timing: []Timing{
|
Timing: []Timing{
|
||||||
{
|
{
|
||||||
Source: "HealthCheck",
|
Source: "HealthCheck",
|
||||||
TimeMillis: time.Since(start),
|
ExecutionTime: time.Since(start),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Response: HealthCheckResponse{
|
Response: HealthCheckResponse{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package handlers_test
|
package handlers_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"testing"
|
"testing"
|
||||||
@ -35,7 +36,11 @@ func TestIndex(t *testing.T) {
|
|||||||
app.Handler().ServeHTTP(w, req)
|
app.Handler().ServeHTTP(w, req)
|
||||||
// app.Index(w, req)
|
// app.Index(w, req)
|
||||||
res := w.Result()
|
res := w.Result()
|
||||||
defer res.Body.Close()
|
defer func() {
|
||||||
|
if err := res.Body.Close(); err != nil {
|
||||||
|
fmt.Println("Received error: ", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if res.StatusCode != 200 {
|
if res.StatusCode != 200 {
|
||||||
t.Errorf("expected status to be 200, got %d", res.StatusCode)
|
t.Errorf("expected status to be 200, got %d", res.StatusCode)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package handlers_test
|
package handlers_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
@ -16,7 +17,11 @@ func TestNotFound(t *testing.T) {
|
|||||||
|
|
||||||
app.Handler().ServeHTTP(w, req)
|
app.Handler().ServeHTTP(w, req)
|
||||||
res := w.Result()
|
res := w.Result()
|
||||||
defer res.Body.Close()
|
defer func() {
|
||||||
|
if err := res.Body.Close(); err != nil {
|
||||||
|
fmt.Println("Received error: ", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if res.StatusCode != 404 {
|
if res.StatusCode != 404 {
|
||||||
t.Errorf("expected status to be 404, got %d", res.StatusCode)
|
t.Errorf("expected status to be 404, got %d", res.StatusCode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user