gomodifytags
backoff
gomodifytags | backoff | |
---|---|---|
3 | 6 | |
2,285 | 3,460 | |
- | - | |
1.9 | 3.1 | |
2 months ago | 9 months ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gomodifytags
-
Which Tools Do You use daily for Golang development?
gomodifytags
-
Libraries you use most of your projects?
https://github.com/fatih/gomodifytags - generate or modify struct tags
-
Improving the code from the official Go RESTful API tutorial
I suspect it's because Go's general philosophy is that it's better to be verbose and explicit (than terse and magical). Probably falls under "clear is better than clever" from Rob Pike's Go Proverbs: http://go-proverbs.github.io/
I think if this feature was added, it would not be with struct tags, but with an Encoder.SetFieldTransform(json.SnakeCase) or similar setting.
That might be quite a nice feature, actually. You could provide your own function to transform names when marshaling, and for unmarshaling it would strip punctuation and match case insensitively (because it's hard to do the reverse transform, for example should user_id go to UserId or UserID, and if the latter, how does the transform know?).
In any case, it seems like an issue was opened proposing something like that a couple of years ago (https://github.com/golang/go/issues/23027), and Russ Cox responded that the JSON package is basically done, but you could either fork it and add the feature, or use a tool that modifies struct tags like https://github.com/fatih/gomodifytags
backoff
-
Retry operations with constant, delays and exponential backoff strategies
Why this instead of https://github.com/avast/retry-go or https://github.com/cenkalti/backoff ?
-
Gosyphus: Retries with exponential backoff
What about https://github.com/cenkalti/backoff?
-
Libraries you use most of your projects?
In addition to the ones you mentioned, I also always use: + sqlc - Compile SQL to type-safe code + gqlgen - generate GraphQL server from schema + oapi-codegen - Go client and server boilerplate from OpenAPI 3 specifications + pester - Go http calls with retries and backoff + backoff - exponential backoff algorithm in Go
-
retry package for golang
May I suggest directions to improve? - add option for exponential or linear backoff - stop early on non-retriable errors Example: https://pkg.go.dev/github.com/cenkalti/backoff/v4 (do not know about its author, just a package I've been using).
- How to implement a retry mechanism for goroutines?
-
Queuing up API requests with waitgroups?
I have used https://github.com/cenkalti/backoff a few years ago and I don't know if it's the best candidate at this point but it's worth to consider in combination with or as an alternative to x/time/rate if you are going that route.
What are some alternatives?
dynamic-struct - Golang package for editing struct's fields during runtime and mapping structs to other structs.
go-wiki - This is a Golang open-source module that makes it easy to access and parse data from Wikipedia (Wikipedia API wrapper)
gopium - Gopium 🌺: Smart Go Structures Optimizer and Manager
try - Simple idiomatic retry package for Go
retry-go - Simple golang library for retry mechanism
autogold - Automatically update your Go tests
pretty - Pretty printing for Go values
retry - Small, full-featured, 100% test-covered retry package for golang.
go - The Go programming language
pp - Colored pretty printer for Go language