diff options
author | Gusted <williamzijl7@hotmail.com> | 2021-11-15 06:02:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 14:02:53 +0800 |
commit | 253d9e415813e90543cca8d94112c9e4238d39a4 (patch) | |
tree | c60e0dc33e437dfbd4855b9c0b5939351451720f /modules/repository/adopt.go | |
parent | 562785ef4ea8ea4b24da726a4fbf515358ee7084 (diff) | |
download | gitea-253d9e415813e90543cca8d94112c9e4238d39a4.tar.gz gitea-253d9e415813e90543cca8d94112c9e4238d39a4.zip |
Remove unnecassary calls to `filepath.Join` (#17608)
- Partialy resolvess #17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/repository/adopt.go')
-rw-r--r-- | modules/repository/adopt.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repository/adopt.go b/modules/repository/adopt.go index 21477ab7d7..3d895ac484 100644 --- a/modules/repository/adopt.go +++ b/modules/repository/adopt.go @@ -154,7 +154,7 @@ func ListUnadoptedRepositories(query string, opts *db.ListOptions) ([]string, in count := 0 // We're going to iterate by pagesize. - root := filepath.Join(setting.RepoRootPath) + root := filepath.Clean(setting.RepoRootPath) if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { if err != nil { return err |