Skip to content

Instantly share code, notes, and snippets.

@maratori
maratori / golang-mocks.md
Last active October 31, 2025 15:20
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2025-05-31

[gomock][1] [testify][2] + [mockery][3] [mockio][4] [minimock][5] [moq][6]

Library

GitHub stars [![s1]][1] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s6]][6]
Latest release date [![d1]][r1] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d6]][r6]
Maintained
@maratori
maratori / .golangci.yml
Last active December 5, 2025 13:50
Golden config for golangci-lint
# ==================================================================================================
#
# NOTICE
#
# This gist is no longer maintained. It was moved to repo:
#
# https://github.com/maratori/golangci-lint-config
#
# Full history and all v2 releases are preserved in the repo.
#
@lldld
lldld / go2 error handling feedback.md
Last active January 19, 2025 17:11
go2 error handling feedback

Import symbol ! to passthrough errors

! is abbreviation of not nil

For example, to call function Sub in caller

func Sub(...) (T1, T2, error) {...}