mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-24 03:21:36 +01:00
3c1bcdb1e2
use active user as owner by default Fix #163 Part1 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/178 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: mrsdizzie <info@mrsdizzie.com>
22 lines
445 B
Go
22 lines
445 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package utils
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// PathExists returns whether the given file or directory exists or not
|
|
func PathExists(path string) (bool, error) {
|
|
_, err := os.Stat(path)
|
|
if err == nil {
|
|
return true, nil
|
|
}
|
|
if os.IsNotExist(err) {
|
|
return false, nil
|
|
}
|
|
return true, err
|
|
}
|