template

module
v0.0.0-...-3288de0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT

README

template

Base template for Go servers. It is barebones by design to just provide a starting point for new projects.

Opinions

The template is opinionated in the following ways:

  • Uses slog as the structured logger
  • Uses chi as the router
  • Uses goose for database migrations
  • Uses sqlx to extend the stdlib sql package
  • Uses env for loading environment variables into structs

Requirements

The project has a few requirements that need to be met in order to work.

Usage

A new project can be created using the experimental gonew tool. More details about the tool can be found in this post.

  1. Installation
go install golang.org/x/tools/cmd/gonew@latest
  1. Create a new project from the template
gonew github.com/ffss92/template <project-name> <folder>

Directories

Path Synopsis
cmd
api command
internal

Jump to

Keyboard shortcuts

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