1 Star 0 Fork 0

sun / common_pkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
location.go 388 Bytes
一键复制 编辑 原始数据 按行查看 历史
yzsunjianguo 提交于 2023-09-19 21:35 . init
// Package certfile is used to locate the certificate file.
package certfile
import (
"path/filepath"
"runtime"
)
var basepath string
func init() {
_, currentFile, _, _ := runtime.Caller(0) //nolint
basepath = filepath.Dir(currentFile)
}
// Path return absolute path
func Path(rel string) string {
if filepath.IsAbs(rel) {
return rel
}
return filepath.Join(basepath, rel)
}
Go
1
https://gitee.com/jianguosun_admin/common_pkg.git
git@gitee.com:jianguosun_admin/common_pkg.git
jianguosun_admin
common_pkg
common_pkg
v1.0.4

搜索帮助

53164aa7 5694891 3bd8fe86 5694891