Returning a Mock from a package function
问题 I'm fairly new to Go and I'm having some issues with writing tests, specifically mocking the response of a package function. I'm writing an wrapper lib for github.com/go-redis/redis . At the moment it only really has better errors for failures, but it will be expanded with statsd tracking further down the line, but I digress... I have the following go package that I have created package myredis import ( "time" "github.com/go-redis/redis" errors "github.com/pkg/errors" ) var newRedisClient =