Open vksrinivasan1 opened 1 year ago
Just looking at the code, I think it's reasonable to move strings.IndexByte(raw, ' ')
before the opts
creation and take the entire value of raw
if there was no space found. I'm happy to make the change, lemme know
Just looking at the code, I think it's reasonable to move
strings.IndexByte(raw, ' ')
before theopts
creation and take the entire value ofraw
if there was no space found. I'm happy to make the change, lemme know
Yeah this change sounds good to me, if you have a minute to contribute it that's great, if not let me know and I can standup a PR from the details you've shared here
Version of dd-trace-go v1.48.0
Describe what happened: We have an existing app that sends the
PING
command to redis (without any additional arguments). This worked in v1.47.0, but it results in a panic todayIt's panicking here while trying to extract the command name by looking for the first space in the raw command -- in single element commands like
PING
without arguments, there is no space so this fails. v.1.47.0 usesstrings.Split()
which would return a slice even if a space wasn't present. It looks like this was changed to indexing up to the first space in v1.48.0 for efficiency reasons.Describe what you expected: I would not expect a panic to occur/I would expect the command to go through.
Steps to reproduce the issue:
Additional environment details (Version of Go, Operating System, etc.):