goinit

command module
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2023 License: MIT Imports: 1 Imported by: 0

README

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官网

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL