[go-nuts] graphql and upload file

2023-05-28 Thread Kamal Sahmoud
i am using graphql-go and currently i cannot found any good solution to 
upload file using graphql can u share any article, example, github etc 
about this spent
i really spent a lot of time but until know cannot fixe this issue of 
upload file using graphql 
thank u

-- 
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/9b4279ac-d46d-4145-ad67-950c82f58044n%40googlegroups.com.


Re: [go-nuts] Using struct{} for context keys

2023-05-28 Thread burak serdar
Two values A and B are equal (A==B) if A and B have the same type and the
same values. In a code where

 a:=clientContextKey{}
  b:=clientContextKey{}

a==b is true, because they have the same types, and they have the same
values (i.e. the empty value).

Note however:

a:=&clientContextKey{}
b:=&clientContextKey{}

It is not guaranteed that a==b, neither is it guaranteed that a!=b. The
compiler may choose to allocate the same address for the zero-size
variables a and b, or it may not,

On Sun, May 28, 2023 at 7:01 AM cpu...@gmail.com  wrote:

> I've recently stumbled across code like this
> https://go.dev/play/p/u3UER2ywRlr:
>
> type clientContextKey struct{}
>
> ctx := context.Background()
> ctx = context.WithValue(ctx, clientContextKey{}, "foo")
> _, ok := ctx.Value(clientContextKey{}).(string)
>
> Naively, I had expected this to fail since I assumed that
> clientContextKey{} would create a new variable instance every time it was
> used and hence the keys would not match.
>
> Why does this use of instantiating the struct type work here?
>
> Thanks,
> Andi
>
> --
> 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/55783f87-bad8-4ca4-9c4a-d8686ae156abn%40googlegroups.com
> 
> .
>

-- 
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/CAMV2RqoMjPmdo1Xri%3DFAz%2BkXwub-Xo7DPyaX%3DB9%2BSG7fKmbDxg%40mail.gmail.com.


Re: [go-nuts] No DNS TTL information in net.LookupSRV()

2023-05-28 Thread TheDiveO
would https://pkg.go.dev/github.com/miekg/dns be an option instead of the 
std lib?

On Friday, May 26, 2023 at 9:45:37 PM UTC+2 Varun Ahluwalia wrote:

> Is there a TTL support in GoLang DNS, or if it was implemented in a later 
> release, please suggest.
> Thanks,
>
> On Saturday, October 8, 2016 at 9:45:17 AM UTC-4 sandro@gmail.com 
> wrote:
>
>>
>>
>> Il giorno mercoledì 13 aprile 2016 22:45:48 UTC+2, Ian Lance Taylor ha 
>> scritto:
>>>
>>> On Wed, Apr 13, 2016 at 12:31 PM, fyodor  wrote: 
>>> > Is there a way to obtain TTL information from through the DNS lookup 
>>> methods 
>>> > in the net package? 
>>>
>>> Not at present. 
>>>
>>> > I'm implementing a component that uses SRV records from a DNS server 
>>> and i 
>>> > noticed TTL number aren't returned with the net.LookupSRV function. 
>>> > 
>>> > 
>>> https://github.com/golang/go/blob/0104a31b8fbcbe52728a08867b26415d282c35d2/src/net/dnsclient.go#L187
>>>  
>>> > 
>>> > The TTL information is in the DNS header returned in the response but 
>>> i 
>>> > can't see a way just getting the header. 
>>> > 
>>> > https://github.com/golang/go/blob/master/src/net/dnsmsg.go#L126 
>>> > 
>>> > Would it be worth my while to implement something for this and submit 
>>> this 
>>> > for inclusion in a forthcoming release of Go? 
>>>
>>> It seems reasonable to me.  You should your API proposal to golang-dev 
>>> before you much time into it. 
>>>
>>
>> Did anything move on this front ? I've the same problem, in look for a 
>> TTL value for my lookups...
>>
>> --strk;
>>
>

-- 
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/79627cb3-faa5-4025-a6ac-3d7e3b872de4n%40googlegroups.com.


[go-nuts] Using struct{} for context keys

2023-05-28 Thread cpu...@gmail.com
I've recently stumbled across code like this 
https://go.dev/play/p/u3UER2ywRlr:

type clientContextKey struct{}

ctx := context.Background()
ctx = context.WithValue(ctx, clientContextKey{}, "foo")
_, ok := ctx.Value(clientContextKey{}).(string)

Naively, I had expected this to fail since I assumed that 
clientContextKey{} would create a new variable instance every time it was 
used and hence the keys would not match.

Why does this use of instantiating the struct type work here?

Thanks,
Andi

-- 
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/55783f87-bad8-4ca4-9c4a-d8686ae156abn%40googlegroups.com.