About 99 results
https://rednafi.com/go/dysfunctional-options-pattern/ · 6 Mar 2024
Discover a simpler alternative to functional options: method chaining with builder-style configuration that's 76x faster and easier to understand.
https://rednafi.com/go/strategy-pattern/ · 17 Feb 2024
Replace inheritance with the Strategy pattern in Go using interfaces. Achieve composable, testable code without class hierarchies.
https://rednafi.com/go/anemic-stack-traces/ · 10 Feb 2024
Learn how to build custom error types in Go to create stack traces without runtime overhead, inspired by Rob Pike's Upspin error handling.
https://rednafi.com/go/retry-function/ · 4 Feb 2024
Build retry logic in Go without reflection using generics. Implement exponential backoff and configurable retry strategies with type safety.
https://rednafi.com/go/type-assertion-vs-type-switches/ · 31 Jan 2024
Master Go type assertions with i.(T) syntax and type switches. Extract concrete types from interfaces safely with ok idiom examples.
https://rednafi.com/go/omit-dev-dependencies-in-binaries/ · 21 Jan 2024
Track dev dependencies like golangci-lint in go.mod with a tools.go file and build tags to exclude them from production binaries.
https://rednafi.com/misc/eschewing-black-box-api-calls/ · 15 Jan 2024
Why you should define API response structures explicitly. Compare approaches in Python, JavaScript, and Go with Pydantic, Zod, and structs.
https://rednafi.com/go/rate-limiting-via-nginx/ · 6 Jan 2024
Implement rate limiting at the infrastructure layer with Nginx reverse proxy. Protect Go services from DDoS with leaky bucket algorithm.
https://blog.nove-b.dev/posts/display-api-swagger-ui-golang · 28 Dec 2023
タイトルにあるようにSwaggerで作成したいのであれば、yamlを作成すればいい。 だけど、そんなことをするのは面倒くさい。 というのもNestJsではデコレーターを追加するだけで自動でSwagger UI...
https://blog.nove-b.dev/posts/handle-expired-jwt-access-token-golang · 22 Dec 2023
アクセストークンの有効期限は短く ログイン認証を作るうえで、アクセストークンの有効期限は短い方がいい、という情報を得た。 アクセストークンが盗まれた時に、備えてのことらしい...