ok. got it

my thinking is 'b' is obvious choice, then why invent new name 'p' ?

On Sat, Apr 6, 2019 at 11:15 PM Jan Mercl <0xj...@gmail.com> wrote:

> It can be whatever you like: passedBuf, payload, putBuffer, param,
> pointer, ...
>
> It does not have to represent any word after all. Naming is hard, but in
> the case of a single argument it does not matter that much, so it could be
> just a case of author's C habits: void *p for buffers.
>
> On Sat, Apr 6, 2019, 19:34 Santhosh T <santhosh.tek...@gmail.com> wrote:
>
>> seems my question is not clear.
>> my question is regarding naming of variables.
>> i know that single name variables in go is idiomatic.
>>
>> r for reader
>> w for writer
>> etc...
>>
>> Read(p []byte) (n int, err error)
>>
>> i dont get why argument is named 'p' instead of 'b'.
>> there should be some reasoning.
>> I dont get why 'p' is chosen as argument name instead of 'b'.
>>
>> thanks
>> Santhosh
>>
>>
>> On Sat, Apr 6, 2019 at 9:54 PM Philip Chapman <pchap...@pcsw.us> wrote:
>>
>>> p is the array of bytes that you want to fill with data read.  The
>>> method returns the count of the number of bytes read which may be any value
>>> from zero to p's length.  You must make multiple reads if the thing being
>>> read from holds more data than your buffer array can hold.
>>>
>>> On Sat, Apr 6, 2019 at 9:16 AM Santhosh T <santhosh.tek...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> method in io.Reader interface is:
>>>>     Read(p []byte) (n int, err error)
>>>>
>>>> what does `p` stands for ?
>>>>
>>>> thanks
>>>> Santhosh
>>>>
>>>> --
>>>> 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.
>>>>
>>>
>>>
>>> --
>>> Philip A. Chapman
>>> Java Software Development
>>> Enterprise, Web, and Desktop
>>>
>> --
>> 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.
>>
>

-- 
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