Skip to content

Unify Configuration and Initialization #536

@MrAlias

Description

@MrAlias

Being consistent in how we configure and create things in the project means users can easily anticipate what they need to do. Currently this is not the case.

We should standardize on the approach outlined in this comment:

type Option func(*Config)
type Config struct { ... }
func NewT(config Config) *T { ... }
func ConfigureT(opts ...Option) *T { 
  config := Config{}
  for _, opt := range opts {
    opt(&config)
  }
  t := NewT(config)
  // ...
}

Metadata

Metadata

Assignees

Labels

pkg:APIRelated to an API package

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions