mirror of https://github.com/go-gitea/gitea.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8b0aaa5f86
A testing cleanup. This pull request replaces `os.MkdirTemp` with `t.TempDir`. We can use the `T.TempDir` function from the `testing` package to create temporary directory. The directory created by `T.TempDir` is automatically removed when the test and all its subtests complete. This saves us at least 2 lines (error check, and cleanup) on every instance, or in some cases adds cleanup that we forgot. Reference: https://pkg.go.dev/testing#T.TempDir ```go func TestFoo(t *testing.T) { // before tmpDir, err := os.MkdirTemp("", "") require.NoError(t, err) defer os.RemoveAll(tmpDir) // now tmpDir := t.TempDir() } ``` Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> |
2 years ago | |
---|---|---|
.. | ||
buffer.go | 3 years ago | |
buffer_test.go | 3 years ago | |
colors.go | 3 years ago | |
colors_router.go | 3 years ago | |
conn.go | 3 years ago | |
conn_test.go | 3 years ago | |
console.go | 3 years ago | |
console_other.go | 3 years ago | |
console_test.go | 4 years ago | |
console_windows.go | 4 years ago | |
errors.go | 6 years ago | |
event.go | 3 years ago | |
file.go | 2 years ago | |
file_test.go | 2 years ago | |
flags.go | 5 years ago | |
groutinelabel.go | 3 years ago | |
groutinelabel_test.go | 3 years ago | |
level.go | 4 years ago | |
level_test.go | 4 years ago | |
log.go | 3 years ago | |
log_test.go | 3 years ago | |
logger.go | 3 years ago | |
multichannel.go | 2 years ago | |
provider.go | 3 years ago | |
smtp.go | 2 years ago | |
smtp_test.go | 4 years ago | |
stack.go | 3 years ago | |
writer.go | 3 years ago | |
writer_test.go | 4 years ago |