How to start a Go project in 2023

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • gow

    Missing watch mode for Go commands. Watch Go files and execute a command like "go run" or "go test" (by mitranim)

    The article mentions GOW[0] for a file watcher. If anyone is looking for a non-go specific one, I've really enjoyed reflex[1]. Makes it super easy to reload different parts of a project based on what type of file has changed.

    [0]https://github.com/mitranim/gow

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • reflex

    Run a command when files change (by cespare)

  • golangci-lint

    Fast linters runner for Go

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • goreleaser

    Release engineering, simplified

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • optgen

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • zerolog

    Zero Allocation JSON Logger

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • cobra

    A Commander for modern Go CLI interactions

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • spicedb

    Open Source, Google Zanzibar-inspired database for scalably storing and querying fine-grained authorization data

    Things I can't live without in a new Go project in no particular order:

    - https://github.com/golangci/golangci-lint - meta-linter

    - https://goreleaser.com - automate release workflows

    - https://magefile.org - build tool that can version your tools

    - https://github.com/ory/dockertest/v3 - run containers for e2e testing

    - https://github.com/ecordell/optgen - generate functional options

    - https://golang.org/x/tools/cmd/stringer - generate String()

    - https://mvdan.cc/gofumpt - stricter gofmt

    - https://github.com/stretchr/testify - test assertion library

    - https://github.com/rs/zerolog - logging

    - https://github.com/spf13/cobra - CLI framework

    FWIW, I just lifted all the tools we use for https://github.com/authzed/spicedb

    We've also written some custom linters that might be useful for other folks: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • entr

    Run arbitrary commands when files change

  • chi

    lightweight, idiomatic and composable router for building Go HTTP services

    A better answer would be some recommendations for component pieces. e.g., I will need most of the essential things in https://github.com/go-chi/chi, so why bother rolling a version myself? The same goes for things like sqlx. I'm averse to leaning on a "framework," but do find good value in targeted libraries.

  • subcommands

    Go subcommand library.

    Cobra is just so… intense and complicated. Google's Subcommands is enough for 99.9% of projects I've worked on

    - https://github.com/google/subcommands

  • goda

    Go Dependency Analysis toolkit

    which prints a sorted ASCII table with stats like 'size:4.4MB loc:134171' for each package, which is an estimate the savings you'd get if you eliminated that package from your binary.

    Things that are unexpectedly large tend to jump to the top.

    The examples in the README are the best way to get started after 'go install github.com/loov/goda@latest'.

    [0] https://github.com/loov/goda

  • air

    ☁️ Live reload for Go apps

    Just to add to the list there is also https://github.com/cosmtrek/air

  • thefuck

    Magnificent app which corrects your previous console command.

    >spellcheck on commands

    I prefer to just type "fuck":

    https://github.com/nvbn/thefuck

  • Reloader

    A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!

    The go k8s packages are pretty bloated - this may also just be a niche case. If you are looking to get secrets with hot reloading, you might also consider mounting a file or setting env vars and coupling it with this reloading operator: https://github.com/stakater/Reloader

  • testcontainers-go

    Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

  • goleak

    Goroutine leak detector

  • go-binsize-treemap

    🔍 Go binary size SVG treemap

    go-binsize-treemap[1] is the best tool for this by a large margin. I came across it because of the exact same reason as you did actually, k8s client bloating my binary massively.

    [1] https://github.com/nikolaydubina/go-binsize-treemap

  • go

    The Go programming language

    - might be the same info as https://github.com/golang/go/milestone/279 in a different form

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Raw-dogging PostgreSQL with pgx and sqlc in Go

    1 project | dev.to | 27 Sep 2024
  • Testcontainers-Go: Effortless Container-Based Testing for Go Developers

    1 project | news.ycombinator.com | 14 Aug 2024
  • Golang REST API boilerplate

    12 projects | dev.to | 4 Jun 2024
  • Montrez patte blanche : tuez des mutants !

    8 projects | dev.to | 16 May 2024
  • Using test helpers in Go

    1 project | dev.to | 16 Feb 2024

Did you konow that Go is
the 4th most popular programming language
based on number of metions?