go-project-template
go-project-template copied to clipboard
A template for new Go projects.
Go Project Template
This project acts as a template for new Go projects I develop. Most of my projects follow a certain structure:
- there is a
Makefilewith common targets so everyone can easily build and test the project- the applications version and build time is set at compile time through
ldflags - there is a
checktarget to lint the code and ensure that it is properly formatted - it uses vgo and the new module system
- the applications version and build time is set at compile time through
Run
$ git clone https://github.com/klingtnet/go-project-template.git
$ cd go-project-template
$ make
$ ./example
INFO[0000] [email protected] build time: 2017-07-03T12:31:38+00:00
Use
How to use this as a start for a new project:
$ git clone --depth=1 https://github.com/klingtnet/go-project-template.git my-new-project
and adjust the module path in the go.mod file.
Development
- build the project:
make - test the project:
make test - clean build artifacts and vendor folder:
make clean