rekby/fixenv

Possible panic if testName contains no "/"

arovesto opened this issue · 1 comments

fixenv/env.go

Line 202 in 72c6b1f

return parts[0]

rekby commented

Thanks for report.

It will no panic: if testName not contains "/" - parts will contain one element with full original string.
https://pkg.go.dev/strings#SplitN
Edge cases for s and sep (for example, empty strings) are handled as described in the documentation for Split.

https://pkg.go.dev/strings#Split
If s does not contain sep and sep is not empty, Split returns a slice of length 1 whose only element is s.

https://play.golang.org/p/wGmBcEYrNyS