gomodule / gomodule/redigo

v2 Proposal

Open
#661 2 comments 3 reactions 1 assignee Claimed by @stevenh View on GitHub
Enhancement
Dominant language
Go
Stars
9.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

# The Problem
The current design of the API in redigo is making it difficult to maintain and with development of new patterns in golang it's time to consider a new major version to address these challenges as it's not possible to address these issues in a backward compatible way.

# The Solution
There are a number of key changes that would help enable easier maintenance of redigo, detailed below.

## Concrete Return Types
The biggest change is likely to be the removal of Conn interface, which makes it impossible to add new features without consumers using type checks for additional interfaces. Changing to concrete type returns, which is widely recommended, would eliminate this problem, allowing new features to be introduced easily. The thinking is that dial methods would return a concrete Conn type and the Pool get methods a PoolConn type.

## Functional Options
Having all values on Pool type public means that it's impossible to change its internal design to incorporate enhancements. It also introduces risk as the consumer may believe it's ok to alter these once constructed which is not the case. Changing to use functional options would address this issue, improving efficiency and extensibility.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.