[go-nuts] Re: best framework for web development in golang

2023-07-21 Thread ben...@gmail.com
Hi "programmer programmer", Perhaps you're young and inexperienced, but this post and your previous one come across as poor questions, even lazy and spammy. There are a lot of articles on the internet that answer this very thing: just

Re: [go-nuts] net/http: invalid byte in Cookie.Value; dropping invalid bytes

2023-07-21 Thread Kurtis Rader
> The Cookie session is encoded with gob Encode. It should only contain plain text strings right? No. Where did you get that idea? See https://pkg.go.dev/encoding/gob#hdr-Encoding_Details On Fri, Jul 21, 2023 at 3:32 PM Tong Sun wrote: > Hi Gophers, > > I'm facing a very weird error: > > func

[go-nuts] net/http: invalid byte in Cookie.Value; dropping invalid bytes

2023-07-21 Thread Tong Sun
Hi Gophers, I'm facing a very weird error: func getUserName(w http.ResponseWriter, r *http.Request) string { c, err := r.Cookie("session") if err != nil { http.Redirect(w, r, rootUrl, http.StatusSeeOther) return "" } log.Println("session raw", c.Value) var s session fmt.Printf("%+v\n", s)

[go-nuts] best framework for web development in golang

2023-07-21 Thread programming programmer
best framework for web development in golang -- 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

[go-nuts] Re: How do library functions that accept a context implement context cancellation inside?

2023-07-21 Thread Tamás Gulácsi
It depends. Checking the context (btw "if err := ctx.Err(); err != nil { return err }" is enough, no need for "select") is cheap but not free. So partition for reasonable sized chunks of work. Tamás Gurunandan Bhat a következőt írta (2023. július 21., péntek, 9:21:15 UTC+2): > Sorry - I meant

[go-nuts] Re: How do library functions that accept a context implement context cancellation inside?

2023-07-21 Thread Gurunandan Bhat
Sorry - I meant ..."calling select once per line" be a good point On Fri, Jul 21, 2023 at 12:41 PM Gurunandan Bhat wrote: > Hi, > > Are there any common patterns that standard and 3rd party library > functions use to implement cancelling a context passed to it? I have looked > at the source

[go-nuts] How do library functions that accept a context implement context cancellation inside?

2023-07-21 Thread Gurunandan Bhat
Hi, Are there any common patterns that standard and 3rd party library functions use to implement cancelling a context passed to it? I have looked at the source of exec.CommandContext and it starts the process and spawns a goroutine that kills the process when ctx.Done() is closed. That looks