fix: linter errors for gofumpt and testifylint

This commit is contained in:
tangerineyu 2026-03-23 21:01:22 +08:00
parent 3e5d748e64
commit 1658e4e410
2 changed files with 3 additions and 4 deletions

View File

@ -787,7 +787,6 @@ func (c *Context) saveUploadedFile(
_, err = io.Copy(out, src) _, err = io.Copy(out, src)
return err return err
} }
// Bind checks the Method and Content-Type to select a binding engine automatically, // Bind checks the Method and Content-Type to select a binding engine automatically,

View File

@ -334,10 +334,10 @@ func TestSaveUploadedFileToRootRejectsPathTraversal(t *testing.T) {
err = c.SaveUploadedFileToRoot(f, "../escape.txt", root) err = c.SaveUploadedFileToRoot(f, "../escape.txt", root)
require.Error(t, err) require.Error(t, err)
assert.ErrorContains(t, err, "path escapes") require.ErrorContains(t, err, "path escapes")
_, err = os.Stat(filepath.Join(baseDir, "escape.txt")) _, err = os.Stat(filepath.Join(baseDir, "escape.txt"))
assert.ErrorIs(t, err, os.ErrNotExist) require.ErrorIs(t, err, os.ErrNotExist)
} }
func TestSaveUploadedFileToRootRejectsSymlinkEscape(t *testing.T) { func TestSaveUploadedFileToRootRejectsSymlinkEscape(t *testing.T) {
@ -375,7 +375,7 @@ func TestSaveUploadedFileToRootRejectsSymlinkEscape(t *testing.T) {
require.Error(t, err) require.Error(t, err)
_, err = os.Stat(filepath.Join(outsideDir, "escape.txt")) _, err = os.Stat(filepath.Join(outsideDir, "escape.txt"))
assert.ErrorIs(t, err, os.ErrNotExist) require.ErrorIs(t, err, os.ErrNotExist)
} }
func TestContextReset(t *testing.T) { func TestContextReset(t *testing.T) {