Skip to content

Commit f03afc4

Browse files
author
alpha
committed
update readme
1 parent 13ea368 commit f03afc4

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# goinit
22
goinit create a single package go project in `$GOPATH/src/ or use go mod`
33

4+
## 2021-03-03 update
5+
update to go1.16
6+
47
## 2020-03-21 update
58
add go mod
69
add Dockerfile
@@ -11,20 +14,23 @@ add docker-compose.yml
1114
Download and install it:
1215
`$ go get -u -v github.com/alphayan/goinit`
1316
Create a go project:
14-
`$ goinit -c projectname -f echo -o xorm -m`
17+
`$ goinit -c projectname -f echo -o xorm -s User,Log`
1518

1619
## Get help
1720
Read help dockument:
1821
`$ goinit -h`
1922

2023
## Project directory hierarchy
2124
```
22-
<project>/       
23-
|- -main.go    
24-
|- -config.go
25-
|- -db.go
26-
|- -redis.go
27-
|- -router.go
25+
<project>/
26+
|- -c_controller.go
27+
|- -m_model.go
28+
|- -main.go
29+
|- -s_config.go
30+
|- -s_db.go
31+
|- -s_redis.go
32+
|- -s_router.go
33+
|- -s_response.go
2834
|- -.gitignore
2935
|- -config.toml
3036
|- -go.mod
@@ -33,5 +39,5 @@ Read help dockument:
3339
```
3440
## Tips
3541
打包成可执行程序并压缩
36-
1.使用go build -ldflags '-w -s'进行代码编译,得到.exe文件
42+
1.使用go build -ldflags '-w -s -extldflags "-static"'进行代码编译,得到.exe文件
3743
2.使用upx小工具进行压缩,使得.exe文件大幅度缩小 [upx官网](https://upx.github.io/ "点击upx下载")

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module github.com/alphayan/goinit
33
go 1.16
44

55
retract v0.4.2
6+
67
require github.com/spf13/cobra v1.1.3

0 commit comments

Comments
 (0)