|14 days ago||10 days ago|
|Apache License 2.0||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.
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.
Goreen tea : golang boilerplate for data-intensive microservice
3 projects | dev.to | 11 May 2021
Unit testing with go-mock
Debugging Go Microservices in Kubernetes with VScode
4 projects | dev.to | 9 Apr 2021
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.
Is there any Go library to backup and restore PostgreSQL?
1 project | reddit.com/r/golang | 29 Nov 2021
I don't think so, but you should look at https://github.com/jackc/pgx which have low level features maybe for replication ?
Which SQL driver to use with Postgres
7 projects | reddit.com/r/golang | 27 Nov 2021
Back to basics: Writing an application using Go and PostgreSQL
15 projects | news.ycombinator.com | 22 Nov 2021
The way it parses dates using Unix time causes issues when you compare the values returned due to Go setting the location property:
pgx doesn't seem to handle reconnects the same way lib/pg does, but I haven't tested this recently: https://github.com/jackc/pgx/issues/672
[Question] Suggested way to update a database row using gRPC/PostgreSQL (pgx) ?
3 projects | reddit.com/r/golang | 16 Nov 2021
String manipulation could lead to nasty SQL injections and really because you're using pgx there's no need to do that either, see the Conn.SendBatch method, it should allow you to achieve what you're trying to do: execute multiple queries in a transaction and still get their results. (test example)
How do the database drivers communicate with the database? Is it just through some type of protocol at a certain port?
3 projects | reddit.com/r/golang | 9 Nov 2021
Problem trying to insert data received from Colly web scraper lib into DB via pgx library
2 projects | reddit.com/r/golang | 31 Oct 2021
In the process of trying to get better with Go, I have been trying to create a program that will scrape a subreddit and then save some info into a Postgres table. In this case, I decided to use r/frugalmalefashion and save the title and flair of recent posts into the table. I am using Colly to scrape data, and pgx as the database driver.
psql slow intial connection?
1 project | reddit.com/r/PostgreSQL | 27 Oct 2021
Connecting from my golang app via pgx database driver inside Docker (Alpine linux image) on my windows dev system: < 1s -> fast
7 projects | news.ycombinator.com | 3 Oct 2021
> What kind of language recommends with a straight face that you just duplicate your entire codebase into a v2/ subdirectory?
Not Go at least. You misunderstood the post completely.
Here is an example of how you are supposed to change the import path for subsequent major versions (that is, backwards incompatible versions): https://github.com/jackc/pgx/blob/3599f646293c1b0d381214ab26...
A one-line change to your modfile and the import path is changed.
Go for Backend development
4 projects | reddit.com/r/golang | 6 Sep 2021
Pass on the frameworks at first. just use the std library's net/http package and maybe a really basic router like julien schmidt's httprouter(https://github.com/julienschmidt/httprouter) to do your requests and use pgx(https://github.com/jackc/pgx) for postrgres.4 projects | reddit.com/r/golang | 6 Sep 2021
postgres in go I've mostly seen done with pgx which kind of skates around the typical database/sql method. It's better maintained and faster than the more 'official' postgres driver, but I kind of hated using it.
What are some alternatives?
pq - Pure Go Postgres driver for database/sql
sqlx - general purpose extensions to golang's database/sql
GORM - The fantastic ORM library for Golang, aims to be developer friendly
counterfeiter - A tool for generating self-contained, type-safe test doubles in go
go-sql-driver/mysql - Go MySQL Driver is a MySQL driver for Go's (golang) database/sql package
go-sqlmock - Sql mock driver for golang to test database interactions
zerolog - Zero Allocation JSON Logger
minimock - Powerful mock generation tool for Go programming language
migrate - Database migrations. CLI and Golang library.
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.
monkey - Monkey patching in Go