Our great sponsors
-
cookiecutter
A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
~ cookiecutter https://github.com/lacion/cookiecutter-golang.git full_name [Luis Morales]: Ricardo Castro github_username [lacion]: mccricardo app_name [mygolangproject]: demo project_short_description [A Golang project.]: A demo docker_hub_username [lacion]: mccricardo docker_image [lacion/alpine-base-image:latest]: golang:1.16.5-apline3.14 docker_build_image [lacion/alpine-golang-buildimage]: golang:1.16.5-apline3.14 Select docker_build_image_version: 1 - 1.13 2 - 1.12.9 3 - 1.11.9 Choose from 1, 2, 3 [1]: 1 Select go_mod_or_dep: 1 - mod 2 - dep Choose from 1, 2 [1]: 1 use_docker [y]: y use_git [y]: y use_logrus_logging [y]: y use_viper_config [y]: y use_cobra_cmd [y]: y Select use_ci: 1 - travis 2 - circle 3 - none Choose from 1, 2, 3 [1]: 3 Initialized empty Git repository in /home/mccricardo/test/demo/.git/ [master (root-commit) 2e82ac9] Initial Commit. 13 files changed, 597 insertions(+) create mode 100644 .gitignore create mode 100644 AUTHORS.md create mode 100644 CONTRIBUTING.md create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 README.md create mode 100644 cmd/root.go create mode 100644 cmd/version.go create mode 100644 config/config.go create mode 100644 go.mod create mode 100644 log/log.go create mode 100644 main.go create mode 100644 version/version.go
Go ahead and take a look at the documentation as well as the source code and add one more tool to your automation arsenal.
Now that we have cookiecutter installed, we can define our templates and start using them. Even better is the fact that we can use publicly available templates and start coding right away. For our purposes, we'll be creating a Go project using the cookiecutter-golang template:
If you read Backstage Software Templates maybe you noticed something called cookiecutter. So, what is it? Apart from being awesome, cookiecutter is a command-line utility that is able to create projects from templates. This allows us and our teams to specify templates for projects, use those templates and share them among teams. We can even embed it into other tools, like Backstage.
Related posts
- Why Go is great choice for Software engineering.
- Golang Web: GET Method
- I'm coming from Java and I have been told that I'm writing go like I'm writing Java. Basically creating structs, injecting fields, and attaching methods. What else can I do?
- Como deixar o Swagger com tema dark mode usando Swaggo e Golang
- Golang: Channels