Have a look at net.Dialer <https://pkg.go.dev/net#Dialer>. It is
essentially a struct that adds optional, keyword arguments to net.Dial
<https://pkg.go.dev/net#Dial>.

On Thu, Aug 17, 2023 at 3:44 AM Jon Perryman <jon.perry...@gmail.com> wrote:

> Struct does not solve the basic problem. In what way are you suggesting to
> solve the described os.open() changes? Should each API be seperate from
> os.open where it must be used with every read/write?
>
> On Wed, Aug 16, 2023 at 6:14 PM Kurtis Rader <kra...@skepticism.us> wrote:
>
>> Personally, and I say this as a happy user of Python, I dislike keyword
>> parameters. Note that in Python keyword parameters are (or should be)
>> seldom used for anything other than optional arguments. And if your API has
>> so many parameters that they need names the API probably needs refactoring.
>> Alternatively, pass a struct whose contents can be initialized using the
>> struct member names.
>>
>> On Wed, Aug 16, 2023 at 6:04 PM Jon Perryman <jon.perry...@gmail.com>
>> wrote:
>>
>>> Do you feel your GOLANG API implementations allows your API's
>>> and functions to evolve and grow? Personally, positional args has pissed me
>>> off for years when a proven simple solution has never been adopted by most
>>> Unix programming languages (except Javascript). Most notably, it's missing
>>> from GOLANG.
>>>
>>> Everyone here understands and uses os.open from the os package.  For
>>> argument's sake, let's say os.open() is your responsibility to integrate
>>> nosql, memory files, compression, encryption, btree, key indexed files and
>>> more. How do you modify os.open( ) to integrate these file related
>>> features? This was solved years ago in languages not used in Unix
>>> using keyword arguments that also included positional. For example:
>>>
>>> func os.open(name string, memoryfile= bool, compress= bool, btree{
>>> btree_optons string }, encrypt{ key= string }, nosql{ nosql_options string
>>> } ) (*File, error)
>>> os.open('myfile.txt', encrypt{ key='abc' }, compress=true)
>>>
>>> The os.open args 1, 3 and 5 would be set from the specified arguments.
>>>
>>>  Is this something that others need and I should pursue or should I just
>>> forget it? Proposal https://github.com/golang/go/issues/62078 was
>>> closed with "I don't see anything concrete being proposed here.". If I
>>> should pursue this, should I reword it or reduce it to this Email?
>>>
>>> Thanks, Jon.
>>>
>>> --
>>> 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/CAByJhJnkuai27VNiE6PraU9-5hoO85Hm__0UQJrT75a7KqD8uw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/golang-nuts/CAByJhJnkuai27VNiE6PraU9-5hoO85Hm__0UQJrT75a7KqD8uw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Kurtis Rader
>> Caretaker of the exceptional canines Junior and Hank
>>
> --
> 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/CAByJhJnTVs-gkQqnFtQ-kvJ%2Bqhnehij13hDh7yv4AoAXuxvKLg%40mail.gmail.com
> <https://groups.google.com/d/msgid/golang-nuts/CAByJhJnTVs-gkQqnFtQ-kvJ%2Bqhnehij13hDh7yv4AoAXuxvKLg%40mail.gmail.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/CAEkBMfEi6hSGB87RNXdtQmP5dWkC8%2Bh%2B7R4L07GBbGa8GwCHsw%40mail.gmail.com.

Reply via email to