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 | |
---|---|---|
.. | ||
agit | 3 years ago | |
asymkey | 2 years ago | |
attachment | 2 years ago | |
auth | 2 years ago | |
automerge | 3 years ago | |
comments | 3 years ago | |
context | 3 years ago | |
cron | 2 years ago | |
externalaccount | 3 years ago | |
forms | 3 years ago | |
gitdiff | 2 years ago | |
issue | 2 years ago | |
lfs | 3 years ago | |
mailer | 2 years ago | |
migrations | 2 years ago | |
mirror | 3 years ago | |
org | 2 years ago | |
packages | 2 years ago | |
pull | 2 years ago | |
release | 2 years ago | |
repository | 2 years ago | |
task | 2 years ago | |
user | 2 years ago | |
webhook | 2 years ago | |
wiki | 2 years ago |