https://github.com/klingtnet/go-project-template
A template for new Go projects.
https://github.com/klingtnet/go-project-template
example go golang template vendor vgo
Last synced: about 16 hours ago
JSON representation
A template for new Go projects.
- Host: GitHub
- URL: https://github.com/klingtnet/go-project-template
- Owner: klingtnet
- License: mit
- Created: 2017-07-03T11:37:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-28T08:09:04.000Z (about 6 years ago)
- Last Synced: 2024-06-20T17:41:12.017Z (over 1 year ago)
- Topics: example, go, golang, template, vendor, vgo
- Language: Makefile
- Size: 23.4 KB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Project Template
[](https://github.com/klingtnet/go-project-template/actions)
This project acts as a template for new Go projects I develop.
Most of my projects follow a certain structure:
- there is a `Makefile` with 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 `check` target to lint the code and ensure that it is properly formatted
- it uses vgo and the new module system
## Run
```bash
$ git clone https://github.com/klingtnet/go-project-template.git
$ cd go-project-template
$ make
$ ./example
INFO[0000] Example@0.0.1-2-g9c29ba5 build time: 2017-07-03T12:31:38+00:00
```
## Use
How to use this as a start for a new project:
```sh
$ 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`