|7 days ago||14 days ago|
|MIT License||Mozilla Public License 2.0|
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.
Implementing Graceful Shutdown in Golang
2 projects | reddit.com/r/golang | 17 Nov 2021
[Question] How to split main.go into separate packages/files whilst maintaining Dependency Injection?
8 projects | reddit.com/r/golang | 26 Aug 2021
Try fx https://github.com/uber-go/fx. I separate my code into packages in exactly the same way that you want to do and fx takes care of the DI.
Any workflow with dependent functions?
2 projects | reddit.com/r/golang | 10 Aug 2021
Gracefully shutting down multiple servers in a single prorgam
2 projects | reddit.com/r/golang | 13 Jul 2021
I really like use fx as a dependency and lifecycle manager (https://github.com/uber-go/fx) here’s an example of how it can gracefully handle multiple server startups and shutdowns (https://github.com/brandenc40/green-mountain-grill/blob/master/server/server/server.go#L37)
Show HN: We wrote a book about building business applications in Go
7 projects | news.ycombinator.com | 13 May 2021
Take a look at the major DI frameworks for Go, Wire  and FX . They just plumb the gaps between methods that return types and methods that want them. Although technically they work for concrete types, 99% of the time it's going to be an interface, so that you can substitute a mock for testing.
Prior to DI frameworks we used global variables, often initialized in a package's init() method.
>The desire to do this reflects a misunderstanding of interfaces.
Generally you have a few layers: gRPC/HTTP/Kafka handler, business logic, and database or external service access. Layers are unit tested individually against mocks of the layers below. Because you're going to inject a mock, you can't depend on a concrete type, so you depend on an interface. Often when you're developing you want to know what the concrete implementation of a lower layer does, so it's useful to have "go-to-definition" see through the interface declaration to its implementations.
I think the implicit satisfaction of interfaces is very cool and I wish I had it in every language. I wouldn't give it up just to simplify the IDE's job. But the IDE having this functionality does matter.
Dependency injection in golang
1 project | reddit.com/r/golang | 23 Apr 2021
Cryptogalaxy : An app to get crypto market data from multiple exchanges, written in Go
1 project | reddit.com/r/golang | 8 Apr 2021
Loos interesting. I would consider adding Makefile with tasks for building, testing, linting. Storage might be implemented as an interface in order to swap it more easily in the future (hexagonal architecture). Maybe uber/fx for dependency injection. Besides that, you can start working on the integration of other 350+ exchanges ;). Drop me a PM if you are interested in crypto tracking projects (we are building popular project in that space :)
Dependency Injection 2021
4 projects | reddit.com/r/golang | 24 Jan 2021
I use uber-go/fx in production and all my personal projects.
Fat-pointer nil check weirdness in Hashicorp's multierror package
1 project | reddit.com/r/golang | 11 Nov 2021
Error wrapping: lowest most or upper most?
1 project | reddit.com/r/golang | 27 Oct 2021
If you're trying to merge together multiple errors, perhaps you want go-multierror?
Return multiple dependent errors in Go?
2 projects | reddit.com/r/golang | 8 Apr 2021
There are a few libraries that solve this problem. One is https://github.com/uber-go/multierr , another https://github.com/hashicorp/go-multierror . They have similar APIs and are pretty easy to use. If you don't want to import another library, it's pretty easy to do something similar yourself, inspired by them. 😊
Question about nil checking interface values
1 project | reddit.com/r/golang | 3 Feb 2021
(Protip: You generally don't want that to be a bool; it ought to return why it is invalid, and, ideally, all the reasons why it is invalid. Bools drop a lot of info on the ground here.)
Proper Error Handling in Go (or maybe just in programming in general)
1 project | reddit.com/r/golang | 14 Jan 2021
What are some alternatives?
dig - A reflection based dependency injection toolkit for Go.
wire - Strict Runtime Dependency Injection for Golang
captcha - :sunglasses:Package captcha provides an easy to use, unopinionated API for captcha generation
container - A lightweight yet powerful IoC dependency injection container for Go projects
deckmaster - An application to control your Elgato Stream Deck on Linux
todo-api-microservice-example - Go microservice tutorial project using Domain Driven Design and Onion Architecture!
watermill - Building event-driven applications the easy way in Go.
conv - Fast conversions across various Go types with a simple API.
btc-vanity - Generate Bitcoin Vanity Address
Miniflux - Minimalist and opinionated feed reader
archiver - Easily create & extract archives, and compress & decompress files of various formats
linker - Dependency Injection and Inversion of Control package