|about 1 month ago||8 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.
[HELP] how to test this piece of code?
1 project | reddit.com/r/golang | 29 Dec 2021
There is a good lib for db tests https://github.com/DATA-DOG/go-sqlmock
I share my authentication server.
18 projects | reddit.com/r/golang | 20 Dec 2021
Continuous Integration - Testify, sqlmock, Mockery, Github Actions
[HELP] Testing SQL queries and functions that use SQL queries in Golang.
3 projects | reddit.com/r/golang | 1 Dec 2021
For testing DB queries I use https://github.com/DATA-DOG/go-sqlmock for unit tests. I then have a separate integration test suite that runs against all our services using Docker.
What are the REST API reference projects that can be used as a guide in 2021?
10 projects | reddit.com/r/golang | 24 Nov 2021
However your point is valid. Check matryer/is for unit test writing. DATA-DOG/go-sqlmock to test database interactions.
Go Package for better integration tests: github.com/ory/dockertest
4 projects | dev.to | 23 Apr 2021
We have different ways to write our tests depending on what datastore we are using, for example if we are testing database calls that happen to be using database/sql then importing a package like github.com/DATA-DOG/go-sqlmock could work.
tidb-lite: used for unit testing of Golang database-related code
2 projects | dev.to | 14 Feb 2021
Another common method is to mock SQL services in the test. At present, the more popular solution is to use go-sqlmock.
How to mock DB for unit tests?
4 projects | reddit.com/r/golang | 8 Feb 2021
I've been using https://github.com/DATA-DOG/go-sqlmock. It's pretty well documented, should be enough to get going.4 projects | reddit.com/r/golang | 8 Feb 2021
I've never bothered with any ORM, but for mocking the underlying sql.DB I've been using https://github.com/DATA-DOG/go-sqlmock which is very simple and straightforward to use.
Dependency Injection in Golang
1 project | dev.to | 20 Jan 2022
If you want to write tests, DI also can help you! Sometimes you need mocks for tests (to be independent of some modules like logger in tests), you have to generate it! There is an amazing tool for this task in go - GoMock. When you describe only needed methods in DI interface, the GoMock generate mocks just for those methods - it is faster and more readable in practice, than hundreds methods in mocks.
What is the real USP of Go's interfaces when compared to those in Java or C#?
1 project | reddit.com/r/golang | 9 Dec 2021
I really disagree with this statement. In fact, there is a Google-developed mocking tool in the official Go organization - https://github.com/golang/mock. I am not a huge fan of mocking and I avoid it when I can, but there is nothing that indicates you must be writing Java code in Go if you're using mocks. You'll even find the use of mocks in the Go standard library test code.
Gerando mocks de interfaces no go!
2 projects | dev.to | 10 Nov 2021
What mocking framework do you prefer?
6 projects | reddit.com/r/golang | 23 Oct 2021
Gomock or mockery?6 projects | reddit.com/r/golang | 23 Oct 2021
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
1 project | reddit.com/r/golang | 6 Aug 2021
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?
1 project | reddit.com/r/golang | 3 Aug 2021
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?
15 projects | reddit.com/r/golang | 25 Jul 2021
https://github.com/golang/mock - Auto generate mocks from interfaces for unit testing
Flexible mocking for testing in Go (without using a framework)
3 projects | reddit.com/r/golang | 20 Jul 2021
BTW https://github.com/golang/mock is way more propular and does similar things.
My experience trying TDD for the first time in Go
1 project | dev.to | 27 May 2021
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.
What are some alternatives?
sqlx - general purpose extensions to golang's database/sql
counterfeiter - A tool for generating self-contained, type-safe test doubles in go
zerolog - Zero Allocation JSON Logger
pgx - PostgreSQL driver and toolkit for Go
Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
minimock - Powerful mock generation tool for Go programming language
monkey - Monkey patching in Go
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.
go-txdb - Immutable transaction isolated sql driver for golang
mockery - A mock code autogenerator for Golang
gotests - Automatically generate Go test boilerplate from your source code.