How to start a Go project in 2023
11–20 of 205 posts
Re: How to start a Go project in 2023
#12Re: How to start a Go project in 2023
#13I'd add "What's the best web framework?" and answer it with "No." (Go comes batteries included)
Re: How to start a Go project in 2023
#14well 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…
I used to use buildflags before this, but my linter ignored those files so they were hard to maintain
Re: How to start a Go project in 2023
#15Re: How to start a Go project in 2023
#16Would there something similar for a next, second, step that focuses on go concurrency aspects?
Go (and erlang/elixir) as touted as concurrency-ready platforms and good overviews of setups, tools and best practices might help more people benefit.
Re: How to start a Go project in 2023
#17 go mod init mymodule
Go's default toolchain is fine, everything else is optional. Some questionable advice in the article:- Vendoring dependencies using "go mod vendor" is not a good default workflow - it bloats the repo, the checked in code is impossible to review, and is generally a pain to keep up to date. Don't, unless you really have to.
- There's no point in stripping a binary or even using UPX on it unless you're targeting extremely low memory environments (in which case Go is the wrong tool anyways), all it'll do it make it harder to debug.
Re: How to start a Go project in 2023
#18Things 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://godoc.org/github.com/ory/dockertest/v3 - run containers for e2e testing - https://github.com/ecordell/optgen - generate functional options - https://golang.org/x/…
Re: How to start a Go project in 2023
#19Re: How to start a Go project in 2023
#20I'd add "What's the best web framework?" and answer it with "No." (Go comes batteries included)