mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-22 09:37:48 +08:00
Less naked returns (#25713)
just a step towards #25655 and some related refactoring
This commit is contained in:
@ -11,7 +11,6 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@ -78,7 +77,7 @@ func TestServeContentByReadSeeker(t *testing.T) {
|
||||
defer seekReader.Close()
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
ServeContentByReadSeeker(r, w, "test", time.Time{}, seekReader)
|
||||
ServeContentByReadSeeker(r, w, "test", nil, seekReader)
|
||||
assert.Equal(t, expectedStatusCode, w.Code)
|
||||
if expectedStatusCode == http.StatusPartialContent || expectedStatusCode == http.StatusOK {
|
||||
assert.Equal(t, fmt.Sprint(len(expectedContent)), w.Header().Get("Content-Length"))
|
||||
|
Reference in New Issue
Block a user