Skip to content
/ go-template Public template

Go template for new projects

Notifications You must be signed in to change notification settings

RedeployAB/go-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Go template

Go templates for new projects

This repository is a template to make use of when creating new projects in Go. It contains scripts, Dockerfile(s) and workflows.

Four templates are provided:

Getting started

To create a new project based on one of the templates:

  1. Install gonew (if it is not already installed):
go install golang.org/x/tools/cmd/gonew@latest
  1. Download the template and create the new project:
# Assuming the project will be hosted in GitHub.
# If not replace github.com/<owner>/<repo> with the correct path.
gonew github.com/RedeployAB/go-template/templates/<name> github.com/<owner>/<repo>

Example

To create a new project based on the http-server template to a GitHub repository with the user/organization name YourUser and the project/module name myproject

gonew github.com/RedeployAB/go-template/templates/http-server github.com/YourUser/myproject

Note: The directory and files will be created in the current working directory. Given the example path development/go, running the gonew command will create the new myproject into development/go/myproject.

This will download the module, it's assets and rewrite the module name and import paths to match the new module name (project).

About

Go template for new projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published