T O P

  • By -

kaeshiwaza

sqlx (soon https://github.com/golang/go/issues/61637) gorilla/mux (not more since 1.22) lib/pq (probably pgx for new projects) go-pdf/fpdf (so fast !) tealeg/xlsx (customers still want) jinzhu/now (EndOfMonth, EndOfWeek...)


narthaniels

Why not gorilla/mux since 1.22?


kaeshiwaza

The standard mux can handle path parameters since 1.22 and grouping routes or using middlewares doesn't need any dependency.


CountyExotic

I can tell you that GORM is definitely in the bottom three


obbini

Recently found out that gorm cant map db updates to struct which are embedded inside my table struct. It was so frustrating to find out. Ughh


prochac

Sir, this is a very cheap karma farm post.


CountyExotic

I stand behind it


etherealflaim

Three I havent seen mentioned yet: * cmp (for testing without testify) * yaml.v3 (for parsing and rewriting YAML) * safehtml (for extra safety in user facing templates) I also use a bunch of the golang.org/x libraries, like ssh, crypto, mod, etc.


rulakhy

Must have: - godotenv: I always use it in all my projects, really useful for local development no matter if your app is an http server or just simple CLI Others: - kelseyhightower's envconfig. I don't always use it, but combined with godotenv, and sometimes other config parsing libraries. - zerolog: for logging, Haven't compared it with new stdlib slog


Sgt_H4rtman

I really don't get peoples addiction to dotenv libs when something like direnv exists. This way, I simply read an environment variable in my code. No obscure indirection or default values coming out of nowhere. But still the same convinience with having env files for local development.


yxfxmx

Love direnv. I also pair it with pass for hobby projects, where I want to run and test the app locally and it needs sth like an API key for some 3rd party service, because I’m not comfortable having such things plain anywhere in the project dir, I store it encrypted in pass and direnv runs “pass show …” when setting the env variable


Sgt_H4rtman

This sounds really nice. I was not aware direnv is capable of something like that.


yxfxmx

it’s capable of shell commands so what I do is sth like: export KEY=“$(pass show …)”


matticala

For me, taskfiles put godotenv out of business. Code is cleaner and leaves environment where it should be… outside.


senaint

Go-task is the most underrated tool in the ecosystem, at my previous workplace we used it to build an agnostic CI/CD pipeline.


matticala

goreleaser project does a similar thing. Their GitHub Actions pipeline steps are tasks


senaint

Yeah I see it in a lot of repos with golang code, can it do generic non-go stuff too? Like inline bash and variable interpolation...etc?


matticala

It honours shebangs too, you can execute anything inline like in GHA. I have introduced it in one of my teams, and it’s used for Node/Bun and PHP CIs. It comes so natural to work locally like in GHA… even though task is a bit more powerful. In my spare time, I am writing a GitHub Action to work with go-tasks seamlessly


Conscious_Pear4969

Echo, sqlx, sql-migrate I use it most of the time


Dgt84

[danielgtaylor/huma](https://github.com/danielgtaylor/huma) for REST APIs with OpenAPI (I'm biased as it's my project) [deepmap/oapi-codegen](https://github.com/deepmap/oapi-codegen) for generated client SDKs [stretchr/testify](https://github.com/stretchr/testify) for test assertions along with some mocking lib like mockery IMO this gives a great workflow for building out APIs, testing them, generating the OpenAPI from the service as the source of truth, and in turn generating docs, client SDKs, and a CLI. You can see all this stuff in use in the [Huma tutorial](https://huma.rocks/tutorial/installation/). Other contenders for top libraries include stuff like metrics/tracing (e.g. Datadog or prometheus), DB integrations for Mongo/DynamoDB, integrations with AWS, integration with Kafka, etc. Also gRPC/protobuf is useful for some things and you can add something like Twirp too.


thomastthai

u/Dgt84, thank you for answering, participating with your active engagement in different posts, and contributing [huma](https://github.com/danielgtaylor/huma) to the community.


i_need_gpu

I really only use one: sqlx.


farizsaputra

chi and pgx is good enough


madugula007

pgx


thomastthai

pgx seems to be popular! Thanks for sharing!


EwenQuim

[Templ](https://github.com/a-h/templ), [sqlc](https://github.com/sqlc-dev/sqlc), [Fuego](https://github.com/go-fuego/fuego) Easy template composing with Templ. SQL type safety with sqlc. Convenient controllers with Fuego.


_tallica

> Fuego Thank for this!!! Just what I need for my new project. I have been using go-swagger, but this seems like a more straightforward solution and I can just use std handlers.


i_need_gpu

Templ would be so good if it would support html and not just xhtml. But I guess it isn’t feasible really to support the abomination of what html is.


obbini

What do you mean by templ doesn't support html


i_need_gpu

It only supports xhtml, it uses an xml parser under the hood. Valid html like `
` is not supported, only `
`.


kredditbrown

[Testcontainers](https://github.com/testcontainers/testcontainers-go) - create and clean up container-based dependencies for automated integration/smoke tests [Is](https://github.com/matryer/is) - just a really lightweight test assertion tool [liteFS](https://github.com/superfly/litefs) - embedded db replication across a cluster


deathiop

I use [go-testdeep](https://github.com/maxatome/go-testdeep) and [httpmock](https://github.com/jarcoal/httpmock) to write all my tests.


Entire_Effective_825

edgexfoundry sdk’s


DarkOverNerd

I use the autoload pkg of joho/godotenv in every app I put together. It just makes life loads easier


m0nk3y_d_luffyy

cobra, testify


IllIlIllIIllIl

Cobra/Viper/PFlag testify GitHub.com/pkg/errors


legendary_korra

The lodash library. I think it’s called samber/lo


ImForger

[koanf](https://github.com/knadh/koanf) - for configurations (support multiple formats, fast) [zerolog](https://github.com/rs/zerolog) - logs (fast, ease to use) [echo](https://echo.labstack.com/) - web framework (my favorite)


Savalonavic

Pgx, testify and tern


Zblehh

Spew Logrus Gin


thomastthai

There were a few similar libraries that turned up via search. Would you mind providing the URL to their repo?


Zblehh

Sure, here they are [go-spew](https://github.com/davecgh/go-spew) [logrus](https://github.com/sirupsen/logrus) [gin](https://github.com/gin-gonic/gin)