Tag

Gomock

0 views collected around this technical thread.

Go Programming World
Go Programming World
May 12, 2024 · Backend Development

Resolving MySQL Dependencies in Go Unit Tests with Fake and Mock Objects

This article explains how to write Go unit tests for HTTP handlers that depend on MySQL by using fake implementations and the gomock library to replace the store layer, demonstrating both fake object and mock approaches, code examples, and best practices for isolating external dependencies.

FakeGoGomock
0 likes · 18 min read
Resolving MySQL Dependencies in Go Unit Tests with Fake and Mock Objects
Amap Tech
Amap Tech
Nov 26, 2020 · Backend Development

Practical Guide to Unit Testing and Mocking in Go Backend Services

This guide explains how to embed robust unit tests in Go backend services, outlines the AIR testing principles and common pitfalls, and demonstrates three practical mocking techniques—database stubs, interface‑based gomock, and runtime monkey‑patching—plus CI integration and coverage reporting.

CIGinGo
0 likes · 16 min read
Practical Guide to Unit Testing and Mocking in Go Backend Services