diff --git a/pkg/app/fs.go b/pkg/app/fs.go index 475d35326..dd9e1f40e 100644 --- a/pkg/app/fs.go +++ b/pkg/app/fs.go @@ -58,6 +58,7 @@ import ( "strings" "sync" "time" + "github.com/cloudwego/hertz/internal/bytesconv" "github.com/cloudwego/hertz/internal/bytestr" "github.com/cloudwego/hertz/internal/nocopy" @@ -1343,7 +1344,6 @@ func (r *smallRangeReader) Close() error { } func (r *smallRangeReader) Read(p []byte) (int, error) { - ff := r.ff var err error cPos, cLen, n := 0, 0, 0 diff --git a/pkg/app/fs_test.go b/pkg/app/fs_test.go index 529552e5e..628ed8281 100644 --- a/pkg/app/fs_test.go +++ b/pkg/app/fs_test.go @@ -53,11 +53,12 @@ import ( "strings" "testing" "time" + + "github.com/cloudwego/hertz/internal/bytesconv" "github.com/cloudwego/hertz/pkg/common/test/mock" "github.com/cloudwego/hertz/pkg/protocol" "github.com/cloudwego/hertz/pkg/protocol/consts" "github.com/cloudwego/hertz/pkg/protocol/http1/resp" - "github.com/cloudwego/hertz/internal/bytesconv" ) func TestNewVHostPathRewriter(t *testing.T) { @@ -413,7 +414,6 @@ func testFSSingleByteRangeOfWriteTo(t *testing.T, h HandlerFunc, filePath string body1, bytesconv.B2s(expectedBody[start:end+1]), filePath, startPos, endPos) } } - } func testFSSingleByteRangeOfRead(t *testing.T, h HandlerFunc, filePath string) { @@ -630,7 +630,6 @@ func testFSMultiByteRangeOfWriteTo(t *testing.T, h HandlerFunc, filePath string) if body != string(singleBodys) { t.Fatalf("multipart ranges content is invalid") } - } func testFSMultiByteRangeOfRead(t *testing.T, h HandlerFunc, filePath string) {