mdempsky/unconvert

False positive with using loop variable as a pointer

Closed this issue · 2 comments

https://go.dev/play/p/Uu5xmbWdvDY

The workaround to this would be to change line 11 to:

		sTmp = string(s)
		ssPtr[i] = &sTmp

But this gives unnecessary conversion (unconvert)

Is it possible to use the workaround of changing line 11 to this instead?

s := s
ssPtr[i] := &s

Does that avoid unnecessary conversion (unconvert)?

Yes, thank you. Works fine.