go-template

module
v0.0.0-...-aafc371 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT

README

go-template

Goreport status Test status

Toolbox and building blocks for new Go projects, to get started quickly and right-footed!

Pick and choose whatever is useful to you! Don't feel the need to use everything, or even to follow this structure.


Getting started

Build CLI

make build-cli

Build HTTP server

make build-httpserver

Install dev dependencies

go install mvdan.cc/gofumpt@v0.4.0
go install honnef.co/go/tools/cmd/staticcheck@2024.1.1
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3
go install go.uber.org/nilaway/cmd/nilaway@v0.0.0-20240821220108-c91e71c080b7
go install github.com/daixiang0/gci@v0.11.2

Lint, test, format

make lint
make test
make fmt

Database tests (using a live Postgres instance)

Database tests will be run if the RUN_DB_TESTS environment variable is set to 1.

# start the database
docker run -d --name postgres-test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres

# run the tests
RUN_DB_TESTS=1 make test

# stop the database
docker rm -f postgres-test

Directories

Path Synopsis
cmd
cli
Package common contains common utilities and functions used by the service.
Package common contains common utilities and functions used by the service.
Package database exposes the postgres database
Package database exposes the postgres database
migrations
Package migrations contains all the migration files
Package migrations contains all the migration files
vars
Package vars contains the database variables such as dynamic table names
Package vars contains the database variables such as dynamic table names
Package httpserver implements the core HTTP server
Package httpserver implements the core HTTP server
Package metrics implements a very opinionated take on metrics.
Package metrics implements a very opinionated take on metrics.

Jump to

Keyboard shortcuts

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