|
@@ -7,7 +7,7 @@ package lfs
|
|
|
import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
- "io/ioutil"
|
|
|
+ "io"
|
|
|
"net/http"
|
|
|
"net/http/httptest"
|
|
|
"testing"
|
|
@@ -24,7 +24,7 @@ func Test_authenticate(t *testing.T) {
|
|
|
m := macaron.New()
|
|
|
m.Use(macaron.Renderer())
|
|
|
m.Get("/", authenticate(), func(w http.ResponseWriter, user *db.User) {
|
|
|
- fmt.Fprintf(w, "ID: %d, Name: %s", user.ID, user.Name)
|
|
|
+ _, _ = fmt.Fprintf(w, "ID: %d, Name: %s", user.ID, user.Name)
|
|
|
})
|
|
|
|
|
|
tests := []struct {
|
|
@@ -178,7 +178,7 @@ func Test_authenticate(t *testing.T) {
|
|
|
assert.Equal(t, test.expStatusCode, resp.StatusCode)
|
|
|
assert.Equal(t, test.expHeader, resp.Header)
|
|
|
|
|
|
- body, err := ioutil.ReadAll(resp.Body)
|
|
|
+ body, err := io.ReadAll(resp.Body)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -311,7 +311,7 @@ func Test_authorize(t *testing.T) {
|
|
|
resp := rr.Result()
|
|
|
assert.Equal(t, test.expStatusCode, resp.StatusCode)
|
|
|
|
|
|
- body, err := ioutil.ReadAll(resp.Body)
|
|
|
+ body, err := io.ReadAll(resp.Body)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -402,7 +402,7 @@ func Test_verifyOID(t *testing.T) {
|
|
|
resp := rr.Result()
|
|
|
assert.Equal(t, test.expStatusCode, resp.StatusCode)
|
|
|
|
|
|
- body, err := ioutil.ReadAll(resp.Body)
|
|
|
+ body, err := io.ReadAll(resp.Body)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|
|
@@ -418,7 +418,7 @@ func Test_internalServerError(t *testing.T) {
|
|
|
resp := rr.Result()
|
|
|
assert.Equal(t, http.StatusInternalServerError, resp.StatusCode)
|
|
|
|
|
|
- body, err := ioutil.ReadAll(resp.Body)
|
|
|
+ body, err := io.ReadAll(resp.Body)
|
|
|
if err != nil {
|
|
|
t.Fatal(err)
|
|
|
}
|