twmb / franz-go

franz-go contains a feature complete, pure Go library for interacting with Kafka from 0.8.0 through 3.6+. Producing, consuming, transacting, administrating, etc.
BSD 3-Clause "New" or "Revised" License
1.6k stars 158 forks source link

Fix typo (update default Acks in comment) in config.go #755

Closed Maks-D closed 2 weeks ago

Maks-D commented 1 month ago

Type Acks description contains a mistake in the default value. According to the default config, the default value of acks is AllISRAcks (code https://github.com/twmb/franz-go/blob/7641d9e673e31217cc353ee8cfc473ba0946891d/pkg/kgo/config.go#L495)

twmb commented 3 weeks ago

Curiously, this same question came up 2d ago internally. Copying my response:


The type has a default value of 0. It’s a struct wrapping an int. 0 means leader ack.

The option defaults internally to -1

This is an example of why the client is option driven, rather than a Config struct — with a Config struct, anything you don’t specify has a 0 default, which would be leader ack. With options, I can internally define a struct with -1, and than you can override if you want.


So, the existing documentation is correct, but if you want to change this to mention that the option defaults to whatever, I may be open to some wording change about that.