The purpose of the template is to show how to organize a project and prevent it from turning into spaghetti code, where to store business logic so that it remains independent, clean, and extensible, how not to lose control when a microservice grows. Configuration. First, config.yml is read, then environment variables overwrite the yaml config if they match. The config structure is in the config.go. The env-required: true tag obliges you to specify a value (either in yaml, or in environment variables). For configuration, we chose the cleanenv library. It does not have many stars on GitHub, but is simple and meets all the requirements. Reading the config from yaml contradicts the ideology of 12 factors, but in practice, it is more convenient than reading the entire config from ENV. It is assumed that default values are in yaml, and security-sensitive variables are defined in ENV.

Features

  • Integration tests
  • Server handler layer (MVC controllers)
  • Server routers are written in the same style
  • Entities of business logic (models) can be used in any layer.
  • Dependency Injection
  • Clean Architecture

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

MIT License

Follow Go Clean template

Go Clean template Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Go Clean template!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-10