Skip to content

Commit

Permalink
Fix: Trim white spaces in user provided shard-ids
Browse files Browse the repository at this point in the history
When specifying a list of shard ids, users are
likely to use white space characters.
This change will sanitise the input before passing
it to sdk calls.
  • Loading branch information
buddhike authored and Buddhike de Silva committed Mar 21, 2023
1 parent 841ba20 commit 39f71fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,9 @@ func (o *options) shardIDs() []string {
if o.sids == "" {
return make([]string, 0)
}
return strings.Split(o.sids, ",")
r := strings.Split(o.sids, ",")
for i, s := range r {
r[i] = strings.TrimSpace(s)
}
return r
}

0 comments on commit 39f71fe

Please sign in to comment.