Last active
March 9, 2020 09:57
-
-
Save shubhamoli/1fc1291d16eb9e1d7a6429b11d1676f1 to your computer and use it in GitHub Desktop.
Bootstrap Directory Structure for fresh GoLang project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Go project bootstrap file | |
# It creates required directory structure and files | |
# | |
# Author: Shubham Oli <[email protected]> | |
# Date: 09-03-2020 | |
# Inspired by: https://github.com/golang-standards/project-layout | |
# Name of project to be bootstrapped | |
NAME=$1 | |
# Let's begin | |
mkdir -p $NAME/src | |
cd $NAME/src | |
touch LICENSE.md | |
touch README | |
touch .gitignore | |
touch Dockerfile | |
touch Makefile | |
# This is where main.go will reside | |
mkdir -p cmd/$NAME | |
touch cmd/$NAME/main.go | |
# Packages which we don't want to expose | |
mkdir -p internal/{config} | |
touch internal/config/config.go | |
# Directory for packages which we want to expose | |
mkdir -p pkg | |
# Directory where systemd scripts, etc will be kept | |
mkdir -p init | |
touch init/$NAME.service | |
# where test config and test data will reside | |
mkdir -p tests | |
# where helm and kubernetes related ymls will be kept | |
mkdir -p deployments/{helm,k8s} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generated tree