Hacker GitHub

← All repos

golang/mock

View on GitHub ↗ ★ 9,318 Go archived

GoMock is a mocking framework for the Go programming language.

11 mentions on Hacker News by 9 people: 2 stories, 9 comments · first 2017-12-11 · latest 2025-11-17

Mentions per year 11 mentions · busiest year 2023 (3)
20082026
  1. …to them. [0] - https://docs.python.org/3/library/unittest.mock.html#unittes... [1] - https://pkg.go.dev/github.com/golang/mock/gomock
  2. …per execution via packages.Load¹, which is by far the primary reason why e.g. go.uber.org/mock (previously github.com/golang/mock) can become extremely slow. mockery v3 does not do this. it type-checks just once for ALL mocks, regardless…
    comment by Groxx · 2025-11-07 · in Revisiting Interface Segregation in Go
  3. The commit mentions this rather sad thread: https://github.com/golang/mock/pull/627#issuecomment-1605169...
    comment by underdeserver · 2023-06-28 · in Google Stopped Maintaining GoMock
  4. …https://golang.org/pkg/testing/ + https://pkg.go.dev/mod/github.com/stretchr/testify - Mocks: https://github.com/golang/mock - Dependency Injection: None, current user of https://github.com/uber-go/dig and I regret it.
  5. …or weeks to automate all of this for C. Meanwhile for Go there exists a tool called ‘mockgen’ ( https://github.com/golang/mock ) that can automatically stomp out mocks for any interface type declared in code. Not just for the ones in your…
    comment by EdSchouten · 2020-03-29 · in How is the Linux kernel tested?
  6. …https://github.com/buildbarn/bb-storage/blob/master/pkg/file... Pretty slick that I can now use https://github.com/golang/mock to automatically generate a mock of that.
    comment by EdSchouten · 2019-08-04 · in Why a mock doesn’t work
  7. also check out https://github.com/golang/mock for mocking
    comment by cdoxsey · 2018-01-01 · in Testing techniques in Go
  8. Looks like there's an official tool: https://github.com/golang/mock
  9. …please don't come bashing me on not contributing to open source, etc.) For mocks, I use GoMocks ( https://github.com/golang/mock ), again a "standard" lib of go. It has Expect syntax where you can assert that mocks were called in a certain…
    comment by ernsheong · 2017-12-11 · in Ask HN: How to approach testing in Golang?