Skip to content

yagnik/go-template

Repository files navigation

Go Template

Go Report Card Go Doc Release Build Status

Basic template for go projects to get started

Setup

  • (PREREQUISITE) Please have docker and docker-compose installed
  • Clone this repo: git clone git@github.com:yagnik/go-template.git
  • Inside the directory where you cloned the repo run: make test.
  • The above will bring up docker containers using docker-compose and run tests to ensure everything is setup properly.
  • Remove the folders as needed according to your project
  • Replace path in makefile to your go code

Directory structure

  • cmd: main applications, directories inside should match executable
  • internal: private package code
  • pkg: public package code
  • vendor: managed by dep tool
  • api: openapi specs, schema and proto files
  • web: web app components, templates etc
  • config: configuration files
  • build: package -> build configs i.e. docker, rpm, ci -> for travis circle etc
  • test: external tests and data
  • examples: examples for applicaton and public packages

Inspired by: