module
0.0.0-20241118172039-580e9a47b1b5
Repository: https://github.com/melenium2/go-template.git
Documentation: pkg.go.dev
# README
Go template
A "business" go template that can be used to quickly initializing a new service. The example contains guidelines on how and where to write the code.
Initializing
Here we have used gonew
tool to initialize the template.
Installing gonew
More about gonew
here.
go install golang.org/x/tools/cmd/gonew@latest
Initializing the project
gonew github.com/Melenium2/go-template <new go.mod name>
For example
gonew github.com/Melenium2/go-template \
github.com/Melenium2/myservice
As a result the myservice
folder will be created in the current directory.
The project will be initialized with specified module name.
# bash
> ls
- ...
- myservice
- ...
// go.mod
module github.com/Melenium2/myservice
go 1.21
# Packages
Package api contains OpenAPI/Swagger specs, JSON schema files, protocol definition files.
Package cmd is main entrypoint for application.
Package db contains content that scripts for database.
Package deployments contains IaaS, PaaS, system and container orchestration deployment configurations and templates (docker-compose, kubernetes/helm, mesos, terraform, bosh).
Package pkg contains code that can be imported by other applications.
Package test contains for setup database for integration tests.