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://godoc.org/github.com/ory/dockertest/v3 - run containers for e2e testing - https://github.com/ecordell/optgen - generate functional options - https://golang.org/x/…
How to start a Go project in 2023
21–30 of 205 posts
Re: How to start a Go project in 2023
#22Re: How to start a Go project in 2023
#23 RUN CGO_ENABLED=0 go build -o mybin -ldflags '-extldflags "-static"' -tags timetzdata
And the second stage like FROM scratch
COPY --from=app-builder mybin mybin
ENTRYPOINT ["/mybin"]
The builder can create users and groups, and the final image can import necessary certs like so: COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/Re: How to start a Go project in 2023
#24[flagged]
Re: How to start a Go project in 2023
#25Things 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
#26Re: How to start a Go project in 2023
#27But it overall seems much nicer than running node/js or python on the server side, no?
Re: How to start a Go project in 2023
#28Things 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/…
You’ve gotta check out Charm’s tools for CLI/TUI dev. They are doing some great work. https://charm.sh/
- https://github.com/charmbracelet/wish - Golang SSH server that makes building SSH apps easy
- https://github.com/charmbracelet/vhs - terminal GIF demos
- https://github.com/charmbracelet/log - minimal and colorful go logs
- https://github.com/charmbracelet/gum - leverage charm's bubbles to write useful TUI shell scripts in any language
Re: How to start a Go project in 2023
#29Things 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/…
Cobra is just so… intense and complicated. It has it's place but Google's Subcommands is enough for 99.9% of projects I've worked on - https://github.com/google/subcommands
Re: How to start a Go project in 2023
#30How to start a new Go project: 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…
Worse, if you run multiple instances of the same binary, none of them can be shared.
A bit simplified, without UPX, 100 processes of 100 MB binaries requires only 100 MB RAM for the code, but with UPX 10 GB.
Edit: In reality, likely only a fraction of that 100 MB needs actually to be mapped into memory, so without UPX true memory consumption is even less than 100 MB.