Skip to content

Commit 59e8645

Browse files
committed
fix🐛 update
1 parent ddc3a1d commit 59e8645

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,35 @@ vi ./config/setting.yml
156156
# 2. 确认log路径
157157
```
158158

159+
:::tip ⚠️注意 在windows环境如果没有安装中CGO,会出现这个问题;
160+
161+
```bash
162+
E:\go-admin>go build
163+
# github.com/mattn/go-sqlite3
164+
cgo: exec /missing-cc: exec: "/missing-cc": file does not exist
165+
```
166+
167+
or
168+
169+
```bash
170+
D:\Code\go-admin>go build
171+
# github.com/mattn/go-sqlite3
172+
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
173+
```
174+
175+
[解决cgo问题进入](https://doc.go-admin.dev/guide/other/faq.html#_5-cgo-exec-missing-cc-exec-missing-cc-file-does-not-exist)
176+
177+
:::
178+
159179
#### 初始化数据库,以及服务启动
180+
160181
``` bash
161182
# 首次配置需要初始化数据库资源信息
162183
# macOS or linux 下使用
163184
$ ./go-admin migrate -c=config/settings.dev.yml
164185

165186
# ⚠️注意:windows 下使用
166-
$ ./go-admin.exe migrate -c=config/settings.dev.yml
187+
$ go-admin.exe migrate -c=config/settings.dev.yml
167188

168189

169190
# 启动项目,也可以用IDE进行调试
@@ -172,7 +193,7 @@ $ ./go-admin server -c config/settings.yml
172193

173194

174195
# ⚠️注意:windows 下使用
175-
$ ./go-admin.exe server -c config/settings.yml
196+
$ go-admin.exe server -c config/settings.yml
176197
```
177198

178199
#### 使用docker 编译启动

common/apis/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Api struct {
1717
Logger *logger.Logger
1818
}
1919

20-
func (e Api) SetContext(c *gin.Context) {
20+
func (e *Api) SetContext(c *gin.Context) {
2121
e.Context = c
2222
}
2323

0 commit comments

Comments
 (0)