On Thu, Feb 23, 2017 at 4:42 AM, Jianhua Li <iu...@icloud.com> wrote:
> func Marshal(v interface{}) ([]byte, error)
>
> func Unmarshal(data []byte, v interface{}) error
>
>
> Why dont the Marshal & Unmarshal use same amount of arguments, and same
> amount of return values like one of these.
>
>
> //1.
>
> func Marshal(data[]byte, v interface{}) (error)
>
> func Unmarshal(data []byte, v interface{}) error
>
>
> //2.
>
> func Marshal(v interface{}) ([]byte, error)
>
> func Unmarshal(v interface{}) ([]byte, error)

Because Marshal and Unmarshal do different things.

I don't see how either suggestion could possibly work.

Ian

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