Skip to content

Commit

Permalink
kgo: breaking change for kversions breaking change
Browse files Browse the repository at this point in the history
This **should** be future compatible and non-breaking at this point.
  • Loading branch information
twmb committed Jan 18, 2021
1 parent b921c14 commit 05346db
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/kgo/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func defaultCfg() cfg {
logger: new(nopLogger),

seedBrokers: []string{"127.0.0.1"},
maxVersions: func() *kversion.Versions { s := kversion.Stable(); return &s }(),
maxVersions: kversion.Stable(),

retryBackoff: func() func(int) time.Duration {
var rngMu sync.Mutex
Expand Down Expand Up @@ -380,8 +380,8 @@ func SeedBrokers(seeds ...string) Opt {
// for the latest version. If using the kmsg package directly to issue
// requests, it is recommended to pin versions so that new fields on requests
// do not get invalid default zero values before you update your usage.
func MaxVersions(versions kversion.Versions) Opt {
return clientOpt{func(cfg *cfg) { cfg.maxVersions = &versions }}
func MaxVersions(versions *kversion.Versions) Opt {
return clientOpt{func(cfg *cfg) { cfg.maxVersions = versions }}
}

// MinVersions sets the minimum Kafka version a request can be downgraded to,
Expand All @@ -396,8 +396,8 @@ func MaxVersions(versions kversion.Versions) Opt {
// Unlike MaxVersions, if a request is issued that is unknown to the min
// versions, the request is allowed. It is assumed that there is no lower bound
// for that request.
func MinVersions(versions kversion.Versions) Opt {
return clientOpt{func(cfg *cfg) { cfg.minVersions = &versions }}
func MinVersions(versions *kversion.Versions) Opt {
return clientOpt{func(cfg *cfg) { cfg.minVersions = versions }}
}

// RetryBackoff sets the backoff strategy for how long to backoff for a given
Expand Down

0 comments on commit 05346db

Please sign in to comment.