A go project generator, which aims to simplify building and releasing go projects by storing all project configuration in a single file called gojen.json, and creates appropriate workflow/git files using that config.

gojen

codecov Release Go Report Card

Define your go project's configuration using a json config. This config can be used to generate a new go project for you, and can also create configs for different tools.

Features

  • Release workflow

If you choose to enable the release workflow, gojen creates a Github actions workflow that simply runs gojen, which lints your code using golangci-lint, runs your tests according to the config, and then creates a release on Github using semantic-go-release. After that it uploads a binary of your built project as an attachment.

  • Build workflow

gojen creates a Github workflow that runs the gojen cli, which builds lints/tests/builds your project.

  • Gitignore

You can define all your gitignore entries inside gojen.json

  • Codeowners

You can define all your codeowners entries inside gojen.json

  • Golangci-lint

Lint your code using golangci-lint

  • Gotest

Arguments for the go test command

Getting started

Install binary

go install github.com/hunter-thompson/gojen

Create a config for your project

printf "{
  "name": "gojen",
  "description": "Go project generator",
  "repository": "github.com/Hunter-Thompson/gojen",
  "goVersion": "1.17",
  "authorName": "Hunter Thompson",
  "authorEmail": "[email protected]",
  "authorOrganization": "Hunter-Thompson",
  "licensed": true,
  "readme": true,
  "gojenVersion": 1.1.1,
  "release": true,
  "buildWorkflow": true,
  "githubToken": "GIT_TOKEN",
  "defaultReleaseBranch": "master",
  "isGojen": false,
  "gitignore": [
	  ".vscode",
	  ".idea",
  ],
  "codeOwners": [
	  "* Hunter-Thompson",
  ],
  "goLinter": true,
  "goTest": true,
  "codeCov": true,
  "goTestArgs": [
	  "-v",
	  "-cover",
	  "./..."
  ]
}" > gojen.json

Generate project

gojen new

Runing gojen after the project has been created does the following things:

  • go mod vendor
  • go mod tidy
  • go fmt
  • golangci-lint
  • go test

Known issues

  1. The default GITHUB_TOKEN cannot be used for the release workflow since if the release is created by the github bot, the upload binary workflow will not run.

So please upload a GITHUB token inside the repo secrets, and add the key to the secret inside gojen.json

Example project

https://github.com/Hunter-Thompson/test-gojen

https://github.com/Hunter-Thompson/gojen - yes gojen uses gojen : )

Notes

This project was inspired by #projen/projen.

Owner
Aatman
DevOps @smallcase
 Aatman
Similar Resources

CUE is an open source data constraint language which aims to simplify tasks involving defining and using data.

CUE is an open source data constraint language which aims to simplify tasks involving defining and using data.

Jan 1, 2023

"there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs.

there "there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs. Despite the existence of the other librarie

Dec 25, 2022

HA LDAP based key/value solution for projects configuration storing with multi master replication support

Recon is the simple solution for storing configs of you application. There are no specified instruments, no specified data protocols. For the full power of Recon you only need curl.

Jun 15, 2022

Fetch web pages using headless Chrome, storing all fetched resources including JavaScript files

Fetch web pages using headless Chrome, storing all fetched resources including JavaScript files. Run arbitrary JavaScript on many web pages and see the returned values

Dec 29, 2022

K8s-network-config-operator - Kubernetes network config operator to push network config to switches

Kubernetes Network operator Will add more to the readme later :D Operations The

May 16, 2022

File-generator - Creates a file filled with bytes

creates a file filled with bytes ./filegen from to from : index of first piece t

Feb 14, 2022

A small utility that aims to automate and simplify some tasks related to software release cycles.

Stork is a small utility that aims to automate and simplify some tasks related to software release cycles such as reading the current version from a f

Nov 9, 2022

Go library to simplify CLI workflow

This is a simple Go library to manage commands for your CLI tool. Easy to use and now you can focus on Business Logic instead of building the command

Dec 22, 2022

Gitlab Command to simplify some Gitlab Workflow

GitLabCommand - glc - README How to use ? ensure glc.yaml is configured with the valid token and url gitlab_token: your valid token gitlab_url: ht

Oct 14, 2021

A customized GORM logger that implements the appropriate interface and uses Logrus to output logs

CryptoMath GORM Logger A customized GORM logger that implements the appropriate interface and uses Logrus to output logs. Install go get github.com/ma

Nov 6, 2021

Frep - Generate file using template from environment, arguments, json/yaml/toml config files

frep Generate file using template from environment, arguments, json/yaml/toml config files. NAME: frep - Generate file using template USAGE: fr

Nov 30, 2022

Project Flogo is an open source ecosystem of opinionated event-driven capabilities to simplify building efficient & modern serverless functions, microservices & edge apps.

Project Flogo is an open source ecosystem of opinionated  event-driven capabilities to simplify building efficient & modern serverless functions, microservices & edge apps.

Project Flogo is an Open Source ecosystem for event-driven apps Ecosystem | Core | Flows | Streams | Flogo Rules | Go Developers | When to use Flogo |

Dec 31, 2022

Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Jan 2, 2022

A tool for building identical machine images for multiple platforms from a single source configuration

A tool for building identical machine images for multiple platforms from a single source configuration

Packer Packer is a tool for building identical machine images for multiple platforms from a single source configuration. Packer is lightweight, runs o

Oct 3, 2021

estruct traverses javascript projects and maps all the dependencies and relationships to a JSON. the output can be used to build network visualizations of the project and document the architecture.

estruct traverses javascript projects and maps all the dependencies and relationships to a JSON. the output can be used to build network visualizations of the project and document the architecture.

EStruct traverses javascript projects and maps all the dependencies and relationships to a JSON. The output can be used to build network visualizations of the project and document the architecture.

Jan 27, 2022

Go-config - Config parser for go that supports environment vars and multiple yaml files

go-multiconfig This package is able to parse yaml config files. It supports gett

Jun 23, 2022

A Golang package for simplifying storing configuration in the OS-provided secret manager.

go-keyconfig A Golang package for simplifying storing configuration in the OS-provided secret manager. Operating System Support OS Secret Manager MacO

Jul 22, 2022

A Git RPC service for handling all the git calls made by GitLab

A Git RPC service for handling all the git calls made by GitLab

Quick Links: Roadmap | Want to Contribute? | GitLab Gitaly Issues | GitLab Gitaly Merge Requests | Gitaly is a Git RPC service for handling all the gi

Nov 13, 2021
Comments
  • feat(project): prepend/append steps to common steps

    feat(project): prepend/append steps to common steps

    			AppendSteps: &[]*github.JobStep{
    				{
    					Name: project.String("appendtest2"),
    					Run:  project.String("test2"),
    				},
    				{
    					Name: project.String("appendtest3"),
    					Run:  project.String("test3"),
    				},
    			},
    			PrependSteps: &[]*github.JobStep{
    				{
    					Name: project.String("prependteststep4"),
    					Run:  project.String("test1"),
    				},
    				{
    					Name: project.String("prependteststep4"),
    					Run:  project.String("test2"),
    				},
    			},
    
  • feat(logging): to stdout and stderr with emojis

    feat(logging): to stdout and stderr with emojis

    ℹ  | Setup | running go mod vendor
    ℹ  | Setup | running go mod tidy
    ℹ  | Setup | running go fmt
    ℹ  | Lint | running go linter
    ✅  | Lint | go linter passed
    ℹ  | Test | running go test
    ✅  | Test | go test passed
    ℹ  | Build | running go build
    ✅  | Build | go build passed
    
Language Server Indexing Format (LSIF) generator for Go

Go LSIF indexer Visit https://lsif.dev/ to learn about LSIF. Installation Binary downloads are available on the releases tab. Installation: Linux curl

Dec 17, 2022
Go Todo Backend example using modular project layout for product microservice.

go-todo-backend Go Todo Backend Example Using Modular Project Layout for Product Microservice. It's suitable as starting point for a medium to larger

Dec 29, 2022
Golang Demo - simple API to get top ranking repos from online csv file

README Generator Description A Demo Golang project, topics : Simple Http Server Get csv from endpoint Convert csv to struct sort slice of struct filte

Dec 3, 2021
go:embed and the golang-standards project layout

An example of using the golang-standards project layout and the go:embed directive.

May 17, 2022
Go Project Sample Layout

go-sample A sample layout for Go application projects with the real code. Where it all comes from? Ideas used to create the architecture and structure

Dec 26, 2022
Standard Go Project Layout

Standard Go Project Layout Translations: 한국어 문서 简体中文 正體中文 简体中文 - ??? Français 日本語 Español Overview This is a basic layout for Go application projects.

Jan 5, 2023
Generate scaffold project layout for Go.

scaffold Scaffold generates starter Go project layout. Let you can focus on buesiness logic implemeted. The following is Go project layout scaffold ge

Dec 11, 2022
Golang Cafe - Go job board with no recruiters and clear salary ranges

Golang Cafe Golang Cafe is the first Go job board with no recruiters & clear salary ranges. Clear salary range in each job description No third party

Jan 6, 2023
Traefik config validator: a CLI tool to (syntactically) validate your Traefik configuration filesTraefik config validator: a CLI tool to (syntactically) validate your Traefik configuration files
Traefik config validator: a CLI tool to (syntactically) validate your Traefik configuration filesTraefik config validator: a CLI tool to (syntactically) validate your Traefik configuration files

Traefik Config Validator Note This is currently pre-release software. traefik-config-validator is a CLI tool to (syntactically) validate your Traefik

Dec 16, 2021