|over 1 year ago||9 days ago|
|GNU General Public License v3.0 or later||Apache 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.
is there an easy (python like way) to do mocks?
reddit.com/r/golang | 2021-10-16
I discovered this lib a few days ago. https://github.com/bouk/monkey it allows you to monkey patch entire functions, replacing them by whatever you want. Perfect for mocking. It's simple to use. The program is hard patching the code using assembly to replace the function address at runtime. You should not use this lib out of your tests since it's absolutely not safe. It's only compatible with linux and windows. But it works great!
reddit.com/r/ProgrammerHumor | 2021-08-23
- Monkey Patching in Go (2015)
I do not give anyone permissions to use this tool for any purpose. Don’t use it. I’m not interested in changing this license. Please don’t ask.
reddit.com/r/programmingcirclejerk | 2021-08-22
Project includes a dependancy that has a license that forbids its use
From the explaining blog post 
> If you’re not interested in how it works and you just want to do monkey patching, then you can find the library here.
> Wrapping it up in a nice library
> I took the above code and put it in an easy to use library. It supports 32 bit, reversing patches, and patching instance methods. I wrote a couple of examples and put those in the README.
Then in the README:
> Make sure you read the notes at the bottom of the README if you intend to use this library.
Either the author is confused or has decided that he doesn't want to maintain an hack. Anyway license is pretty clear.
There was an HN thread when it was released.
"This is as unsafe as it sounds and I don't recommend anyone do it outside of a testing environment."
is Test_xxx func safe to access shared data?
reddit.com/r/golang | 2021-06-25
WRT monkeypatch, again, this is a "global" thing and assuming you are talking about bouk's monkeypatch library the author makes the note that
Go partial mocks?
reddit.com/r/golang | 2021-05-10
For example: https://github.com/bouk/monkey
What mocking framework do you prefer?
reddit.com/r/golang | 2021-10-23
Gomock or mockery?reddit.com/r/golang | 2021-10-23
I used to use Mockery, but it was unmaintained for a long time, and not that great, so these days it's Mock, which is nicer in several ways.
Mocking with High-Order Functions in Go
reddit.com/r/golang | 2021-08-06
Honestly curious - why wouldn't you use something like https://github.com/golang/mock to generate your mocks from an interface. Way more productive, consistent and cleaner. Spend more time and focus on your business logic rather than something that's already been solved.
Constructors: how to keep compatibility in a public API?
reddit.com/r/golang | 2021-08-03
Sorry for badly explaining. Issue explaining it better than me: https://github.com/golang/mock/issues/324
What are the most useful packages you know for Go?
reddit.com/r/golang | 2021-07-25
https://github.com/golang/mock - Auto generate mocks from interfaces for unit testing
Flexible mocking for testing in Go (without using a framework)
reddit.com/r/golang | 2021-07-20
BTW https://github.com/golang/mock is way more propular and does similar things.
My experience trying TDD for the first time in Go
dev.to | 2021-05-27
The first day, I wrote my tests for some GET routes. We use something called go-mock in our unit tests, which allows you to only focus on testing the function you're writing. Because of this, I found that you still needed to have a good idea of the code you want to write while writing out the tests. In our case, we needed to mock out our calls to an external API. If you asked for my opinion after the first day, I would've told you that I could envision the benefits of TDD for something like end to end testing, where it's a black box and you're only verifying that the output is what's expected from a given input. But for unit testing, it wasn't any different than just writing the code first.
Goreen tea : golang boilerplate for data-intensive microservice
dev.to | 2021-05-11
Unit testing with go-mock
Debugging Go Microservices in Kubernetes with VScode
dev.to | 2021-04-09
Sure, you can use unit tests with tools like GoMock and GoStub to simulate external dependencies or introduce synthetic data into the mix, but it still leaves you unsure if it will work with data from your actual services.
Part-2: Building a basic microservice with unidirectional-streaming gRPC using Golang
dev.to | 2021-02-25
To write the unit test we'll need to generate the mock of multiple interface as required. mockgen is the ready-to-go framework for mocking in Golang, so we'll be leveraging it in our unit tests.
What are some alternatives?
counterfeiter - A tool for generating self-contained, type-safe test doubles in go
go-sqlmock - Sql mock driver for golang to test database interactions
sqlx - general purpose extensions to golang's database/sql
minimock - Powerful mock generation tool for Go programming language
zerolog - Zero Allocation JSON Logger
gock - HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
realize - Realize is the #1 Golang Task Runner which enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.
pgx - PostgreSQL driver and toolkit for Go
gotests - Automatically generate Go test boilerplate from your source code.
Mmock - Mmock is an HTTP mocking application for testing and fast prototyping
hoverfly - Lightweight service virtualization/API simulation tool for developers and testers