Bootstrap a new project from a template.

Go Starter

Go-starter allows to bootstrap a new project from a template. It uses Git repositories as templates and is shipped with batch of utilities to make bootstarpping easier.

Learn more

Installation

Download latest release from release page using one of the commands below.

Mac OS

curl https://github.com/adobe/go-starter/releases/latest/download/go-starter-darwin-amd64.tgz \
  -sSfL -o go-starter.tgz

Linux

curl https://github.com/adobe/go-starter/releases/latest/download/go-starter-linux-amd64.tgz \
  -sSfL -o go-starter.tgz

Unpack content of the archive to a directory listed in $PATH. The archive includes multiple binaries shipped with go-starter.

tar -xvzf go-starter.tgz -C /usr/local/bin
rm go-starter.tgz

Run go-starter to verify it's installed correctly.

Usage

Run go-starter with template repository URL and path where you would like to create a new project, for example:

go-starter starter-template/hello-world-starter awesome-project

You can specify full GitHub URL or just repository name (like so starter-template/hello-world-starter).

Now, go-starter will clone hello-world-starter into ./awesome-project directory and run tasks defined in .starter.yml. See "Templates" for more details.

Advanced usage

You can skip cloning, for example if template is already cloned, but task failed to execute by passing -skip-clone flag.

You can also pass additional variables (or pre-define variables instead of entering them using prompt) using -var flag.

Templates

Templates are regular Git repositories like this one. If you try to use go-starter with random repository it will just clone it to your computer. To make use of go-starter you would need to let it know how to "post-process" template repository after it has been cloned. To do so, you need to define .starter.yml configuration file.

After go-starter clones repository it tries to load .starter.yml to execute additional actions and turn template into a project. This configuration file defines two sections:

  • questions - list of questions to be asked from user, for example: project name, binary name, team etc
  • tasks - list of commands to be executed (these can be globally installed binaries, or binaries packed with template itself)

Here is an example of .starter.yml:

questions:
  - message: Application name
    name: "application_name"
    type: input
    regexp: ^[a-z0-9\-]+$
    help_msg: Must be lowercase characters or digits or hyphens
  - message: GitHub owners
    name: "github_owners"
    type: input
    regexp: ^[a-z0-9\-]+$
    help_msg: Must be lowercase characters or digits or hyphens

tasks:
  - command: [ "go-starter-replace" ]
  - command: [ "rm", ".starter.yml" ]

This file defines two questions, asking user to enter application_name and github_owners variables. Then, go-starter will execute go-starter-replace binary (shipped with go-starter) to replace placeholders in the files of the template, turning generic tempalte into something more specific to the project. Finally it will use standard rm command to remove .starter.yml.

Each template may contain custom tasks placed in .starter folder. For example, you can create a bash script which would generate CODEOWNERS file and place it under .starter/make-owners. Then, add it as tasks in .starter.yml like so:

...

tasks:
...
  - command: [ "./.starter/make-owners" ]

Custom scripts may access variables (answers to the questions) through environment variables. They are uppercased and prefixed with STARTER_. Following example above, ./.starter/make-owners may get github_owners variable using STARTER_GITHUB_OWNERS environment variable.

Build-in tasks

Go-starter ships with few additional binaries which can be used as tasks in .starter.yml.

go-starter-replace

This binary recursively goes through files in current folder and replaces placeholders to variable values in files and their names. By default, placeholders are surrounded by < and >.

Usage

Usage: go-starter-replace [flags]

Example:
    STARTER_PLACEHOLDER1=VALUE1 STARTER_PLACEHOLDER2=VALUE2 go-starter-replace

Flags:
  -prefix string
        Placeholder prefix (default "<")
  -suffix string
        Placeholder suffix (default ">")

go-starter-github

This binary automatically created GitHub repository, initiates local Git repository, adds GitHub remote and pushes changes to GitHub.

Usage

Usage: go-starter-github [flags] <github-org> <github-repo>

Example:
    go-starter-github adobe awesome-project

Flags:
  -branch string
        Name of the master branch (default "master")
  -collaborator value
        Add collaborators to the repository by GitHub username. You can grant permissions using following format: <username>:<permission>. Permission can be: pull (read only), push (read and write) or admin (everything), default is push. Can be specified multiple times. Example: --collaborator octocat:pull
  -deploy-key string
        Add SSH deployment key to the repository, add ':rw' suffix to grant write permissions to the key
  -public
        Make repository public
  -remote string
        Name of the remote in local repository (default "upstream")
  -with-issues
        Enable issues in GitHub
  -with-projects
        Enable projects in GitHub
  -with-wiki
        Enable wiki page in GitHub

go-starter-drone

This binary configures drone integration and runs first build.

Usage

Usage: go-starter-drone [flags] <drone-url> <org-name> <repo-name>

Example:
    go-starter-drone https://cloud.drone.io adobe awesome-project

Flags:
  -pull-secret-file value
        Create a secret from file available for pull-requests (eq. --pull-secret-file=secret_name=./path/to/file)
  -pull-secret-literal value
        Create a secret from literal available for pull-requests (eq. --pull-secret-literal=secret_name=value)
  -secret-file value
        Create a secret from file (eq. --secret-file=secret_name=./path/to/file)
  -secret-literal value
        Create a secret from literal (eq. --secret-literal=secret_name=value)
Owner
Adobe, Inc.
Open source from Adobe
Adobe, Inc.
Similar Resources

Generates a simple skeleton directory structure for go/gin/bootstrap web apps

Gin Bootstrap Initializer Generates a simple skeleton directory structure for go/gin/bootstrap web apps Description This package handles building a co

Jan 21, 2022

Made from template temporalio/money-transfer-project-template-go

Made from template temporalio/money-transfer-project-template-go

Temporal Go Project Template This is a simple project for demonstrating Temporal with the Go SDK. The full 20 minute guide is here: https://docs.tempo

Jan 6, 2022

Application open new tab in chrome when your favourite youtuber add new video.

youtube-opener This application open new tab in Chrome when your favourite youtuber add new video. It checks channel every one minute. How to run go r

Jan 16, 2022

Money-transfer-project-template-go - A simple project for demonstrating Temporal with the Go SDK

Money-transfer-project-template-go - A simple project for demonstrating Temporal with the Go SDK

Temporal Go Project Template This is a simple project for demonstrating Temporal

Feb 5, 2022

A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...

A template for creating new Golang + Docker + Canonical Domain + Badges + Renovate + Golangci + Goreleaser + CircleCI + ...

golang-repo-template 😄 golang-repo-template Usage foo@bar:~$ golang-repo-template hello world _

Dec 29, 2022

A go template repository for easily bootstrapping new go applications

Template go Repository tl;dr This is a template go repository with actions already set up to create compiled releases What does this Template provide?

Nov 5, 2021

Go-teemap - This library provide a threadsafe map which use new template feature of Go

TeeMap library This library provide a threadsafe map which use new template feat

Jan 12, 2022

A minimal Crossplane Provider that is meant to be used as a template for implementing new Providers

provider-template provider-template is a minimal Crossplane Provider that is meant to be used as a template for implementing new Providers. It comes w

Jan 16, 2022

Libdns-exoscale - A template for developers to use when creating new libdns provider implementations

DEVELOPER INSTRUCTIONS: This repo is a template for developers to use when creat

Jan 18, 2022

:zap: boilerplate template manager that generates files or directories from template repositories

:zap: boilerplate template manager that generates files or directories from template repositories

Boilr Are you doing the same steps over and over again every time you start a new programming project? Boilr is here to help you create projects from

Jan 6, 2023

Wrapper package for Go's template/html to allow for easy file-based template inheritance.

Extemplate Extemplate is a small wrapper package around html/template to allow for easy file-based template inheritance. File: templates/parent.tmpl

Dec 6, 2022

Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

goview Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Inst

Dec 25, 2022

Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

quicktemplate A fast, powerful, yet easy to use template engine for Go. Inspired by the Mako templates philosophy. Features Extremely fast. Templates

Dec 26, 2022

Simple system for writing HTML/XML as Go code. Better-performing replacement for html/template and text/template

Simple system for writing HTML as Go code. Use normal Go conditionals, loops and functions. Benefit from typing and code analysis. Better performance than templating. Tiny and dependency-free.

Dec 5, 2022

A template to build dynamic web apps quickly using Go, html/template and javascript

A template to build dynamic web apps quickly using Go, html/template and javascript

gomodest-template A modest template to build dynamic web apps in Go, HTML and sprinkles and spots of javascript. Why ? Build dynamic websites using th

Dec 29, 2022

A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

Nov 22, 2021

yview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

wview wview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Instal

Dec 5, 2021

Go-api-template - A rough template to give you a starting point for your API

Golang API Template This is only a rough template to give you a starting point f

Jan 14, 2022

Go-grpc-template - A small template for quickly bootstrapping a, developer platform independent gRPC golang application

Go-grpc-template - A small template for quickly bootstrapping a, developer platform independent gRPC golang application

go-grpc-template A small template for quickly bootstrapping a developer platform

Jan 20, 2022
A simple template using Fiber for me to bootstrap API services quickly.

Fiber Template A simple template using Fiber for me to bootstrap API services quickly. Features Fiber GORM air for hot reloading ... and possibly more

Dec 16, 2021
Use this template to bootstrap the creation of a Golang action

Create an Action using Golang Use this template to bootstrap the creation of a G

Dec 30, 2021
Go-project-template - Template for a golang project

This is a template repository for golang project Usage Go to github: https://git

Oct 25, 2022
Broilerplate - A template project for new Go web backend applications
Broilerplate - A template project for new Go web backend applications

Broilerplate A template project for new Go web backend applications. Can be used

Mar 28, 2022
Fab - fabricate a new project from a template... in a fabulous way

fab fabricate a new project from a template... in a fabulous way :-) setup The f

Jun 1, 2022
:art: Contextual fmt inspired by bootstrap color classes

Cfmt Contextual fmt It provides contextual formatting functions that have nearly identical usage of the fmt package. The ideas were borrowed from boot

Jan 7, 2023
A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.
A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.

Maroto A Maroto way to create PDFs. Maroto is inspired in Bootstrap and uses Gofpdf. Fast and simple. Maroto definition: Brazilian expression, means a

Jan 7, 2023
Package core is a service container that elegantly bootstrap and coordinate twelve-factor apps in Go.

Package core is a service container that elegantly bootstrap and coordinate twelve-factor apps in Go. Background The twelve-factor methodology has pro

Nov 3, 2022
Bootstrap curated Kubernetes stacks. Logging, metrics, ingress and more - delivered with gitops.

Gimlet Stack Bootstrap curated Kubernetes stacks. Logging, metrics, ingress and more - delivered with gitops. You can install logging aggregators, met

Dec 1, 2021
Decrypts and dumps K3s bootstrap data read from stdin.

k3s-dump-bootstrap Decrypts and dumps K3s bootstrap data read from stdin. Note: <token> parameter should be just the bare passphrase, not a full K10-f

Jan 12, 2022