Thank you. I got it now.

// only red part 

*resp.(*string)  // string pointer (type)
*resp.(*string)  // convert interface type to string pointer type 
*resp.(*string)  // *dereferences* the pointer 




On Monday, November 21, 2016 at 6:40:25 PM UTC+1, Sathish VJ wrote:
>
> if resp is an interface, then resp.(string) *type asserts* it into a 
> string.  And that will be ok if the underlying type is a string.
>
> In the question that I asked, the underlying type was not a string, but a 
> pointer to a string.  So he type asserted it into a pointer of string type. 
>  resp.(*pointer).
> Now that we have a pointer to the string, we set it's value as 
> *strPtr="string value".
>
> On Monday, 21 November 2016 22:56:29 UTC+5:30, Ali Altun wrote:
>>
>>
>> Whats is the meaning of   *resp.(*string) = "abcd" .   I have not seen 
>> this before.
>>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to