• Stars
    star
    1,618
  • Rank 28,920 (Top 0.6 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Modern Go Application example

Modern Go Application

Mentioned in Awesome Go Go Report Card go.dev reference

GitHub Workflow Status CircleCI Gitlab

Go application boilerplate and example applying modern practices

This repository tries to collect the best practices of application development using Go language. In addition to the language specific details, it also implements various language independent practices.

Some of the areas Modern Go Application touches:

  • architecture
  • package structure
  • building the application
  • testing
  • configuration
  • running the application (eg. in Docker)
  • developer environment/experience
  • telemetry

To help adopting these practices, this repository also serves as a boilerplate for new applications.

Features

First steps

To create a new application from the boilerplate clone this repository (if you haven't done already) into your GOPATH then execute the following:

chmod +x init.sh && ./init.sh
? Package name (github.com/sagikazarmark/modern-go-application)
? Project name (modern-go-application)
? Binary name (modern-go-application)
? Service name (modern-go-application)
? Friendly service name (Modern Go Application)
? Update README (Y/n)
? Remove init script (y/N) y

It updates every import path and name in the repository to your project's values. Review and commit the changes.

Load generation

To test or demonstrate the application it comes with a simple load generation tool. You can use it to test the example endpoints and generate some load (for example in order to fill dashboards with data).

Follow the instructions in etc/loadgen.

Inspiration

See INSPIRATION.md for links to articles, projects, code examples that somehow inspired me while working on this project.

License

The MIT License (MIT). Please see License File for more information.

More Repositories

1

mga

Modern Go Application tool
Go
78
star
2

caddy-fs-s3

Caddy FS module for AWS S3
Go
53
star
3

helm-charts

Various Helm charts for my own and other projects
Smarty
43
star
4

awesome-argonone

List of Argon ONE links
34
star
5

temporal-intro-workshop

Temporal intro workshop
Go
32
star
6

goci

High-level CI config DSL written in Go based on Dagger
Go
28
star
7

viperx

Viper extensions
Go
22
star
8

go-gin-gorm-opencensus

OpenCensus instrumentation for Gin and Gorm
Go
17
star
9

protoc-gen-kit

Protoc compiler for Go kit code
Makefile
17
star
10

fsig

Send signals to a subprocess when files change
Go
16
star
11

please-go-modules

Go
15
star
12

nix-config

My Nix(OS) configurations
Nix
14
star
13

daggerverse

My Dagger modules
Go
14
star
14

terraform-tiller

Install Tiller on a Kubernetes cluster using Terraform
HCL
13
star
15

todobackend-go-kit

A simple Todo-Backend application written using Go kit
Go
12
star
16

travis-monorepo-demo

This repository is an experiment about building monorepo projects using Travis CI
Shell
11
star
17

cadencelint

A simple linter for checking Cadence workflows and activities for common mistakes
Shell
10
star
18

slog-shim

Backward-compatible shim for log/slog
Go
10
star
19

dagger-go-library

Go library example for Dagger
CUE
7
star
20

ocwatermill

Watermill OpenCensus integration
Go
7
star
21

dagger-go-cli

CUE
6
star
22

mypleasings

Addons & build rules for Please: https://please.build.
Starlark
6
star
23

cadence-intro-workshop

Example code for my Cadence Intro Workshop
Go
5
star
24

locafero

Finder library for Afero
Go
5
star
25

sublime-fuelgenerator

A Sublime Text Plugin which allows using FuelPHP oil generator.
Python
4
star
26

kitx

Go Kit eXtensions
Go
4
star
27

go-option

Optional values for Go
Go
4
star
28

appkit

Opinionated application tools based on go-kit and kitx
Go
4
star
29

setup-please-action

Please setup GitHub action
TypeScript
4
star
30

gbt

Go Build Tool
Go
4
star
31

dagger-go-example

This repository serves as an example for using Dagger Go SDK
Go
4
star
32

gh-stat

GitHub CLI extension for displaying various stats about organizations and repositories
Shell
4
star
33

gdg-budapest-demo-20220922

GDG Budapest demo: Deep dive into Kubernetes secrets
Nix
4
star
34

docker-dvwa

Dockerized version of DVWA
Shell
4
star
35

protoc-gen-go-kit

Protoc compiler for Go kit code
Go
3
star
36

binbrew

Homebrew, but with binaries
Go
3
star
37

gopherjs-vue-bootstrap-example

HTML
3
star
38

equi-nix-k8s

An experiment to run Kubernetes on Equinix Metal using NixOS
Nix
3
star
39

demo-cloud-native-rejekts-na-2023-dagger

Demo: Future-Proof Your Platform’s CI/CD Without Developers Noticing a Thing (Except Unicorns and Rainbows)
Go
3
star
40

workshop-template

Workshop repository template
Nix
3
star
41

cadence-bootstrap

Cadence Bootstrap helps setting up a Cadence instance
Go
3
star
42

makefiles

Common Makefiles
Makefile
3
star
43

demo-bank-vaults-secret-injection

Demo: Bank-Vaults secret injection
Nix
3
star
44

thesis

Source code and related resources for my thesis.
Go
3
star
45

go-withings

Go client for the Withings API
Go
2
star
46

blob-proxy

HTTP proxy for object stores
Go
2
star
47

go-bin-flake

Nix flake for binary distributions of various Go applications
Nix
2
star
48

grpc-intro-workshop

gRPC intro workshop
Go
2
star
49

go-flake

Various tools used for Go development
Nix
2
star
50

cloak-flake

Nix flake for Dagger Cloak
Nix
2
star
51

curiefense-emissary-poc

An attempt to integrate Curiefense into Emissary Ingress
Shell
2
star
52

devenvx

Useful modules for devenv
Nix
2
star
53

dagreleaser

This is a proof of concept module that demonstrates how to release distributable packages using Dagger, similar to how Goreleaser works.
Go
2
star
54

setup-minikube-action

GitHub Action to install minikube
Shell
2
star
55

go-finder

Go finder library
Go
2
star
56

argocd-operator-util

This repo is a fork of the argocd-operator-util tool published by ArgoCD Operator
Dockerfile
1
star
57

go-test-call-dagger

Calling Dagger from go test
Go
1
star
58

github-actions-good-to-know

Some details about how GitHub Actions work
1
star
59

kube-curiesync-injector

Go
1
star
60

nvim-config

My nvim config using 💤 LazyVim
Lua
1
star
61

httpbin

http://httpbin.org clone written in Go to simplify CI usage
Go
1
star
62

dotfiles

My (cross-platform) dotfiles
Shell
1
star
63

ansible-role-qbittorrent-nox

Ansible Role: qBittorrent nox
1
star
64

nix-garden

Nix flake for Garden
Nix
1
star
65

mater

Hugo theme based on Materialize CSS
HTML
1
star
66

please-go

⚠ [PROJECT MOVED] Please Go rules and definitions
Shell
1
star
67

dagger

Dagger library
CUE
1
star
68

demo-bank-vaults

Demonstrate Bank-Vaults features
Nix
1
star
69

kustomize-spotahome-redis-operator

Kustomize deployment manifests for spotahome/redis-operator
1
star
70

demo-oss-na-2023-kube-secret-rotation

Demo: Automating secret rotation in Kubernetes
Makefile
1
star
71

nix-templates

My Nix flake templates
Nix
1
star
72

demo-kcd-romania-2024

Demo: Future-Proof Your Platform’s CI/CD Without Developers Noticing a Thing
Makefile
1
star
73

ghlabels

Manage github labels with ease
Go
1
star
74

bgphp-background-processing-examples

PHP
1
star
75

moddown

Go Module downloader
Go
1
star
76

mapstructurex

Extensions for mapstructure
Go
1
star
77

euclid

A simple sequential ID generator
Go
1
star
78

demo-dagger-helm

Demo: Testing and releasing Helm charts with Dagger
Go
1
star