Open diorcety opened 3 months ago
Sorry, not sure which code you refer to, when linking to code its best to use permalinks then the links stay valid and shows your code even as the code changes.
Will close for now.
@ripienaar this code https://github.com/nats-io/natscli/blob/d55fe64dc973939785e520e5dccfeddca546e605/cli/consumer_command.go#L1264
if cfg.Durable != "" && c.consumer != "" && cfg.Durable != c.consumer {
if c.consumer != "" {
cfg.Durable = c.consumer
} else {
// Never reached
return cfg, fmt.Errorf("durable consumer name in %s does not match CLI consumer name %s", c.inputFile, c.consumer)
}
}
indeed thats dead code, do you want to send a PR to fix?
I fall on that issue during a modification I made in order to read a field "stream_name" from configuration file in order to create a consumer only from a json file cf (https://github.com/diorcety/natscli/commit/78fc5a477f8b684b4a675a0207e0d3f7069f0714) But for this dead code, I can't figure what was the wanted behavior
It's probably just old code from a previous edit left over by accident
Proposed change
Code at line https://github.com/nats-io/natscli/blob/main/cli/consumer_command.go#L1006 is not reachable
At line 1003 c.consumer is always != "" due to conditon at line 1002.
What is the expected behaviour?
Use case
Fix or remove dead code
Contribution
No response