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 | |
---|---|---|
.. | ||
admin.go | 2 years ago | |
admin_auth_ldap.go | 3 years ago | |
admin_auth_ldap_test.go | 3 years ago | |
cert.go | 3 years ago | |
cmd.go | 3 years ago | |
convert.go | 3 years ago | |
docs.go | 3 years ago | |
doctor.go | 2 years ago | |
dump.go | 3 years ago | |
dump_repo.go | 3 years ago | |
embedded.go | 2 years ago | |
embedded_stub.go | 3 years ago | |
generate.go | 4 years ago | |
hook.go | 3 years ago | |
hook_test.go | 4 years ago | |
keys.go | 4 years ago | |
mailer.go | 3 years ago | |
main_test.go | 3 years ago | |
manager.go | 3 years ago | |
manager_logging.go | 3 years ago | |
migrate.go | 3 years ago | |
migrate_storage.go | 2 years ago | |
migrate_storage_test.go | 2 years ago | |
restore_repo.go | 3 years ago | |
serv.go | 3 years ago | |
web.go | 2 years ago | |
web_acme.go | 2 years ago | |
web_graceful.go | 2 years ago | |
web_https.go | 2 years ago |