- build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 (#8)
- build(deps): bump golang.org/x/tools from 0.11.0 to 0.26.0 (#9)
- build(deps): bump github.com/gkampitakis/go-snaps from 0.4.8 to 0.5.7 (#10)
- build(deps): bump go.uber.org/mock from 0.2.0 to 0.5.0 (#11)
- Use go 1.20 (#12)
- Use go 1.22 (#13)
- ci: disable Go dependency cache
- add mockgen to tools dependencies (#5)
- Allow external package mocking like below:
package external
import "database/sql/driver"
// The below command is equivalent to:
// mockgen -package mock_driver -destination ./mock_driver/mock.go database/sql/driver Conn,Driver
//go:generate bulkmockgen MockInterfaces -- -package mock_driver -destination ./mock_driver/mock.go
var MockInterfaces = []any{
new(driver.Conn),
new(driver.Driver),
}
- You can't still mock mixed external packages' interfaces at once. Please split mock set and generatel one by one.
package mixedexternal
import (
"database/sql"
"database/sql/driver"
)
// NG
var Iset = []any{
new(sql.Result),
new(driver.Conn),
}
// OK
var SqlSet = []any{
new(sql.Result),
}
var DriverSet = []any{
new(driver.Conn),
}
- Rename mockgengen to bulkmockgen
- incompatible: switch to wrap mockgen command
- You can use mockgengen with mockgen's command line options.
- eg.
mockgengen MockBars -- -package mock_bar -destination ./mock_bar/mock_bar.go
- migrator: treat consecutive go:generate comment correctly