Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed May 25, 2024
1 parent 6db3d63 commit aab49ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion middleware/static/static_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ func Test_Static_Custom_CacheControl(t *testing.T) {

func Test_Static_Disable_Cache(t *testing.T) {
t.Parallel()

app := fiber.New()

file, err := os.Create("../../.github/test.txt")
require.NoError(t, err)
_, err = file.WriteString("Hello, World!")
require.NoError(t, err)
require.NoError(t, file.Close())

// Remove the file even if the test fails
defer func() {
Expand All @@ -148,7 +150,7 @@ func Test_Static_Disable_Cache(t *testing.T) {
require.NoError(t, err)
require.Contains(t, string(body), "Hello, World!")

require.NoError(t, os.Remove("../../.github/test.txt"))
_ = os.Remove("../../.github/test.txt") //nolint:errcheck // not needed

resp, err = app.Test(httptest.NewRequest(fiber.MethodGet, "/test.txt", nil))
require.NoError(t, err, "app.Test(req)")
Expand Down

0 comments on commit aab49ec

Please sign in to comment.