From 4f27c289472a4cfafb5a9b0e38e6a3413c30c562 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 2 Apr 2022 00:34:57 +0800 Subject: Remove legacy `unknwon/com` package (#19298) Follows: #19284 * The `CopyDir` is only used inside test code * Rewrite `ToSnakeCase` with more test cases * The `RedisCacher` only put strings into cache, here we use internal `toStr` to replace the legacy `ToStr` * The `UniqueQueue` can use string as ID directly, no need to call `ToStr` --- integrations/migration-test/migration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'integrations/migration-test') diff --git a/integrations/migration-test/migration_test.go b/integrations/migration-test/migration_test.go index 0518dd1179..6e55807c27 100644 --- a/integrations/migration-test/migration_test.go +++ b/integrations/migration-test/migration_test.go @@ -21,6 +21,7 @@ import ( "code.gitea.io/gitea/integrations" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/models/migrations" + "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/charset" "code.gitea.io/gitea/modules/git" @@ -60,7 +61,7 @@ func initMigrationTest(t *testing.T) func() { assert.True(t, len(setting.RepoRootPath) != 0) assert.NoError(t, util.RemoveAll(setting.RepoRootPath)) - assert.NoError(t, util.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"), setting.RepoRootPath)) + assert.NoError(t, unittest.CopyDir(path.Join(filepath.Dir(setting.AppPath), "integrations/gitea-repositories-meta"), setting.RepoRootPath)) ownerDirs, err := os.ReadDir(setting.RepoRootPath) if err != nil { assert.NoError(t, err, "unable to read the new repo root: %v\n", err) -- cgit v1.2.3