On Thu, May 19, 2022 at 7:59 AM Amit Saha wrote:
>
>
>
> On Thu, May 19, 2022 at 7:02 AM Amit Saha wrote:
>>
>> Hi all,
>>
>> For a cookie, it seems like both, `Expires` and `MaxAge` must be
specified? The expectation is that, only Max-Age should be sufficient.
>>
>> // valid
>> c1 := http.Cookie
On Wed, May 18, 2022 at 7:36 PM Jeremy Kassis wrote:
>
> Where exactly did this land? Seems like an important conversation...
To date there is no way to write a constraint that requires that a
type argument be a struct type.
> ```
> // RPCHandler passes RPCReq and RPCRes as fn args
> func RPCHa
Where exactly did this land? Seems like an important conversation...
```
// RPCHandler passes RPCReq and RPCRes as fn args
func RPCHandler[T RPCReq, S RPCRes](fn func(T, S)) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
req := T{}
if err := reqBodyRea
On Thu, May 19, 2022 at 7:02 AM Amit Saha wrote:
> Hi all,
>
> For a cookie, it seems like both, `Expires` and `MaxAge` must be
> specified? The expectation is that, only Max-Age should be sufficient.
>
> // valid
> c1 := http.Cookie{
> Expires: time.Now().Add(3600 * 24 * time.Second),
>
So sorry - didn’t look at the api just assumed. Apologies.
> On May 18, 2022, at 4:48 PM, Amit Saha wrote:
>
>
>
>
> On Thu, May 19, 2022 at 7:43 AM Robert Engels wrote:
> >
> > Your first case doesn’t even work - nil is output.
>
>
> That's a nil error - the return value from Valid() -
If it is implemented correctly oauth2 is a standard that uses a Bearer token.
Not sure if the other auth-scheme are usable - then it wouldn’t be oauth.
Sounds like you either need an additional routing header or a different
auth-scheme
> On May 18, 2022, at 3:09 PM, 'Sean Liao' via golang-nuts
On Thu, May 19, 2022 at 7:43 AM Robert Engels wrote:
>
> Your first case doesn’t even work - nil is output.
That's a nil error - the return value from Valid() - indicating that the
cookie is valid.
>
>
> On May 18, 2022, at 4:11 PM, Amit Saha wrote:
>
>
> Hi all,
>
> For a cookie, it seems
Your first case doesn’t even work - nil is output.
> On May 18, 2022, at 4:11 PM, Amit Saha wrote:
>
>
> Hi all,
>
> For a cookie, it seems like both, `Expires` and `MaxAge` must be specified?
> The expectation is that, only Max-Age should be sufficient.
>
> // valid
> c1 := http.Cookie{
>
Hi all,
For a cookie, it seems like both, `Expires` and `MaxAge` must be specified?
The expectation is that, only Max-Age should be sufficient.
// valid
c1 := http.Cookie{
Expires: time.Now().Add(3600 * 24 * time.Second),
MaxAge: 24 * 3600, // 24 hours
}
// invalid
c2 := http.Co
Now that I think about it, it won't work
because oauth2 will Set the Authorization header,
overwriting whatever you might have originally set there.
Maybe it's easier to follow standard oauth and move the original user
authentication into some other header?
On Wed, May 18, 2022 at 8:50 PM 'Patri
Thanks Sean!
I just realized I cited the wrong package in my earlier message. I meant to
refer to the golang.org/x/oauth2/clientcredentials client. I'm not sure if
that matters for the discussion, but I apologize for any confusion.
Is it safe to use a custom transport with this
client?
https
On Wed, May 18, 2022 at 4:42 AM Matt Mueller wrote:
>
> I'm trying to run the type-checker on some code using "go/types". I got it
> working for local packages, but I'm stuck on the following when "errors" is
> imported:
>
> ```
> could not import errors (errors/wrap.go:8:2: could not import
>
doesn't sound like a common use case, might be easier to use a transport
that moves the header?
- sean
On Wed, May 18, 2022, 19:52 'Patrick Kaeding' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> Would it be possible to allow the [header that is used](
> https://github.com/golang/oauth
Would it be possible to allow the [header that is
used](https://github.com/golang/oauth2/blob/2e8d9340160224d36fd555eaf8837240a7e239a7/token.go#L80)
by the golang.org/x/oauth2 client to be overridden?
I imagine the code change would be simple, but would it be accepted?
My use case is that I ha
On Wed, May 18, 2022 at 9:15 AM Harsh Rathore wrote:
>
> I will attach, the Code file and the sTrace logs.
>
> It basically tries to run a shell command via golang.
>
> When I try to run it in ESXI-670, it errors with:
>
> program is running
> fork/exec /bin/sh: no space left on device
>
> Here is
Hi all,
I thought now was the time to go public. The automatic error propagation is
possible with the help of a simple Go package, and it has been about three
years now:
func CopyFile(src, dst string) (err error) {
defer err2.Returnf(&err, "copy %s %s", src, dst)
r := try.To1(os.Open(s
I will attach, the Code file and the sTrace logs.
It basically tries to run a shell command via golang.
When I try to run it in ESXI-670, it errors with:
program is running
fork/exec /bin/sh: no space left on device
Here is what I have tried:
1. I have tried doing this with cmd.Output().
Hey Gophers,
I'm trying to run the type-checker on some code using "go/types". I got it
working for local packages, but I'm stuck on the following when "errors" is
imported:
```
could not import errors (errors/wrap.go:8:2: could not import
internal/reflectlite (internal/reflectlite/value.go:10
Henry,
thank you, it is quite possible that you are right, at least I should check
it out.
Thank you again.
среда, 18 мая 2022 г. в 07:39:49 UTC+3, Henry:
> Kudos to you. Java to Go is a lot of work. Java is a more complex
> language. It has more features and more possibilities for expressing
19 matches
Mail list logo