Skip to content

Commit d8012f4

Browse files
author
wangwei
committed
优化
1 parent 1682f4b commit d8012f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ginhelper 是一个gin web框架的快速搭建项目的助手,帮助你快速
55
## 一、使用方法
66

77
### 1、下载
8-
go get github.com/will110/ginhelper
8+
go get -u github.com/will110/ginhelper
99

1010

1111
### 2、生成项目

project/project.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ func getAppDir() (string, error) {
151151
}
152152

153153
fileList := strings.Split(currentPath, "src")
154-
if len(fileList[1]) == 0 {
154+
if len(fileList[len(fileList) - 1]) == 0 {
155155
return "", errors.New("You must create file in the src directory or go mod project")
156156
}
157157

158-
dir := strings.Replace(fileList[1], string(filepath.Separator), "/", -1)[1:]
158+
dir := strings.Replace(fileList[len(fileList) - 1], getSep(), "/", -1)[1:]
159159

160160
return dir, nil
161161
}

0 commit comments

Comments
 (0)