On Tuesday, November 10, 2020 at 10:09:44 PM UTC+11 
axel.wa...@googlemail.com wrote:

> On Tue, Nov 10, 2020 at 11:09 AM shan...@gmail.com <shan...@gmail.com> 
> wrote:
>
>> This seems to me to be the better solution (but it's still in the 
>> pipeline?) https://github.com/golang/go/issues/19367
>> an unsafe, rather than reflect, access to the slice structure, which 
>> allows a user to do.. interesting things to the object. Am I correct in 
>> thinking that this change (when implemented) removes the reflect 
>> implementations, and does away with the comments?
>>
>
> I agree that with unsafe.Slice there shouldn't be any more use cases that 
> necessitate use of reflect.SliceHeader. I don't think it should be removed 
> outright though. There is no need to break existing programs using it, even 
> if we consider it allowed from the compatibility guarantee. Likewise, the 
> comments should persist, so that readers of existing code can look up its 
> documentation.
>
> We can definitely add a note that unsafe.Slice and &a[0]/len/cap should be 
> used instead, though. 
>

That makes sense. 
 

> But, just to be clear, I also don't think anything substantially changes 
> in terms of compatibility guarantees - unsafe.Slice will give just as 
> little a guarantee as reflect.SliceHeader does today.
>
>
After sleeping on it I realised that that was the case (few guarantees for 
unsafe.Slice), but I feel that the fact that it will be in the unsafe 
package makes this a little more explicit
 

>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/669b67cd-6336-49ae-be04-4eade048b84an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/golang-nuts/669b67cd-6336-49ae-be04-4eade048b84an%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0c774a9f-4f5e-4f93-958f-213f34d02041n%40googlegroups.com.

Reply via email to