go-mockgen
logrus
go-mockgen | logrus | |
---|---|---|
3 | 38 | |
58 | 24,971 | |
- | 0.3% | |
5.6 | 2.2 | |
11 months ago | 3 months ago | |
Go | Go | |
MIT 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.
go-mockgen
-
Is there a mock library works with generics?
https://github.com/derision-test/go-mockgen, we use this widely at work
-
Libraries you use most of your projects?
https://github.com/derision-test/go-mockgen for generating mocks for interfaces, for those that use dependency injection. By far the best mock generator, especially compared to the relatively bad official one, or anything that requires passing method names as strings...
-
What are your favorite packages to use?
https://github.com/derision-test/go-mockgen for the best mocks Ive ever had in Go https://github.com/go-chi/chi for HTTP routing
logrus
-
Top 5 Go Libraries Every Backend Developer Should Know
3. Logrus
-
Building a RESTful API with Go Fiber: An Express-Inspired Boilerplate
Import the logger from src/utils/logrus.go. It is using the Logrus logging library.
-
I curate a daily newsletter with resources about Golang - Daily Golang. Here are the latest 6 issues of the newsletter
sirupsen/logrus Logrus is a structured, pluggable logging library for Go, designed to provide a flexible logging framework that supports various output formats and hooks.
-
Go is my hammer, and everything is a nail
For an internal-only dependency it's possible. But if you've got a lot of active branches, or long-lived feature branches, it'll create chaos in merge conflicts. Even worse if you've got multiple supported versions of a product on release branches (e.g., `main-v1.0`, `main-v1.1`, `main-v1.2`, and `main` itself for the yet-to-be-released `v1.3`) you either make backports awful (by only changing the import path on `main`) or have to change even more things (by changing the import path on the release branches too).
It's effectively impossible for pubic-facing dependencies. Imagine if https://github.com/sirupsen/logrus wanted to change their Go modules import path, for example to move to another git hosting provider. (Logrus is great by the way, I'm only 'picking' on it as a popular Go library that's used everywhere.) GitHub tells me that almost 200,000 Go projects depend on it (https://github.com/sirupsen/logrus/network/dependents), so all of them would need to change every source file they do logging in (probably most of them) in order to handle that.
GitHub seems like it's going to be eternal for now, but when the industry moves on in 10 years time every single Go project is going to break. This would be a problem for any source dependency management solution of course, it's not like any of the others are immune to this issue. But because Go has you encode the Git path in every source file you import it into, the level of change to fix it is an order of magnitude higher.
-
Observability - Why logging its important
The following is an example of displaying logs using the Golang language with various levels. Here we use the Logrus.
-
Beautiful graph visualizations of packages for different managers
The graphics remind me very much of Netwars [1], although the controls of Netwars were a little bit better. However, this feels so good compared to some randomly generated universe, as you know that every star is something meaningful. And you can find actually helpful stuff: I just found logrus [2] a Go library for logging, which sounds cool :-D
1: https://en.wikipedia.org/wiki/NetWars
2: https://github.com/Sirupsen/logrus
-
Authentication system using Golang and Sveltekit - Initialization and setup
It's some sort of logging system well explained by Alex Edwards in Let’s Go Further. As stated, we could have used logrus or any other popular logging system in Go.
-
Renaming public Go modules
Option 2, please. You may not have been around for the logrus debacle, but it was a giant pain.
- What is the common log library which is industry standard that is used in server applications?
-
Observing AWS Lambda with Golang and Datadog
For the example I’m using the very popular logrus library and then I’m setting the log formatter to be JSON
What are some alternatives?
go-wiki - This is a Golang open-source module that makes it easy to access and parse data from Wikipedia (Wikipedia API wrapper)
zap - Blazing fast, structured, leveled logging in Go.
Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
slog
goproc - simple process manager helper library
zerolog - Zero Allocation JSON Logger
httprouter - A high performance HTTP request router that scales well
lumberjack - lumberjack is a log rolling package for Go
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
glog - Leveled execution logs for Go
pggen - Generate type-safe Go for any Postgres query. If Postgres can run the query, pggen can generate code for it.
seelog - Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting.