Skip to content

Instantly share code, notes, and snippets.

@maratori
maratori / golang-mocks.md
Last active May 19, 2024 21:04
Comparison of golang mocking libraries

Comparison of golang mocking libraries

Updated 2024-05-19

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

Library

GitHub stars [![s6]][6] [![s2]][2] + [![s3]][3] [![s4]][4] [![s5]][5] [![s1]][1]
Latest release date [![d6]][r6] [![d2]][r2] + [![d3]][r3] [![d4]][r4] [![d5]][r5] [![d1]][r1]
Maintained :white_check
@maratori
maratori / .golangci.yml
Last active May 20, 2024 04:23
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.58.2
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@lldld
lldld / go2 error handling feedback.md
Last active January 19, 2022 20:10
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) {...}