/go-template

My template of a Golang project with layouts, dir structure, and interfaces.

Primary LanguageGo

go-template

go-template is a Go project template that provides a basic structure and boilerplate code for starting a new Go project. It follows the recommended Go project layout and includes common files and directories to help you get started quickly.

Features

  • Project structure: Follows a standard project layout to organize your Go code.
  • Dependency management: Utilizes Go modules for managing dependencies.
  • Testing setup: Includes a testing setup with sample test cases.
  • Logging configuration: Provides a basic logging configuration using the popular logrus library.
  • Configuration management: Supports configuration loading from environment variables and configuration files using viper.
  • Error handling: Demonstrates error handling approaches using errors package and error wrapping.
  • Build and run scripts: Includes convenient scripts for building and running the project.
  • Docker support: Contains a Dockerfile for containerization.

Prerequisites

Before using this project, make sure you have the following installed:

  • Go (1.16+)
  • Docker (optional)

Getting Started

To get started with the go-template project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/doxanocap/go-template.git
  2. Run docker compose file:

     docker-compose up

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please create an issue or submit a pull request.

License

This project is licensed under the MIT License.