feat: io utils

This commit is contained in:
tx7do
2023-10-27 17:01:35 +08:00
parent e9ea8fa536
commit b4188ca4d8
2 changed files with 5 additions and 2 deletions

View File

@@ -1,10 +1,11 @@
package common
package ioutil
import (
"os"
"path/filepath"
)
// GetWorkingDirPath 获取工作路径
func GetWorkingDirPath() string {
dir, err := os.Getwd()
if err != nil {
@@ -13,6 +14,7 @@ func GetWorkingDirPath() string {
return dir
}
// GetExePath 获取可执行程序路径
func GetExePath() string {
ex, err := os.Executable()
if err != nil {
@@ -22,6 +24,7 @@ func GetExePath() string {
return exePath
}
// GetAbsPath 获取绝对路径
func GetAbsPath() string {
dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
if err != nil {

View File

@@ -1,4 +1,4 @@
git tag v1.1.0
git tag v1.1.2
git tag bank_card/v1.1.0
git tag entgo/v1.1.2
git tag geoip/v1.1.0