Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

alphayan/goinit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

68 Commits

Repository files navigation

goinit

goinit create a single package go project in $GOPATH/src/ or use go mod

2023年03月04日 update

update to go1.20.1

2021年03月03日 update

update to go1.16

2020年03月21日 update

add go mod
add Dockerfile
add docker-compose.yml
//TODO:postgresql

Start using it

Download and install it:
$ go get -u -v github.com/alphayan/goinit
Create a go project:
$ goinit -c projectname -f echo -o xorm -s User,Log

Get help

Read help dockument:
$ goinit -h

Project directory hierarchy

<project>/ 
 |- -c_controller.go
 |- -m_model.go 
 |- -main.go 
 |- -s_config.go 
 |- -s_db.go 
 |- -s_redis.go
 |- -s_router.go
 |- -s_response.go
 |- -.gitignore
 |- -config.toml
 |- -go.mod
 |- -Dockerfile
 |- -docker-compose.yml

Tips

打包成可执行程序并压缩
1.使用go build -ldflags '-w -s -extldflags "-static"'进行代码编译,得到.exe文件
2.使用upx小工具进行压缩,使得.exe文件大幅度缩小 upx官网

About

goinit create a new go web project quickly

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /