How to start a Go project in 2023
boyter.org
How to start a Go project in 2023
1–10 of 205 posts
Re: How to start a Go project in 2023
#2[0]https://github.com/mitranim/gow [1]https://github.com/cespare/reflex
Re: How to start a Go project in 2023
#3The 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 [1] https://github.com/cespare/reflex
Re: How to start a Go project in 2023
#4- 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://godoc.org/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
Re: How to start a Go project in 2023
#5one minor thing: I've skipped using build tags for integration tests because those tests will be out of sync one day with your main code, even with Goland (?).
Instead I use the usual test and check if an environment variable is set, if not, then
t.Skipf("env var %q not set, skipping integration test",envVarName)
or you can use an additional CLI flag, e.g. in `feature_test.go` write func init() { flagIntegration := flag.Bool("test.integration",false,"run int tests") }
then $ go test -v -test.integrationRe: How to start a Go project in 2023
#6Re: How to start a Go project in 2023
#7The 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 [1] https://github.com/cespare/reflex
Re: How to start a Go project in 2023
#8well written post! one minor thing: I've skipped using build tags for integration tests because those tests will be out of sync one day with your main code, even with Goland (?). Instead I use the usual test and check if an environment variable is set, if not, then t.Skipf("env var %q not set, skipping integration test",envVarName) or you can use an additional CLI flag, e.g. in `feature_test.go` write func init() { f…
What do you mean here? What would be out of sync, and what would happen if it were?
Re: How to start a Go project in 2023
#9(Go comes batteries included)
Re: How to start a Go project in 2023
#10The 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 [1] https://github.com/cespare/reflex
# Makefile test: `find * -name "*.go" | entr bash -c "clear; go test ./..."`