Re: [go-nuts] Issues with time.Time

2022-07-21 Thread Andrew Phillips
Thanks for the feedback. I should explain that efficiency is not (currently) a problem. The thing I love about Go is that there is always a simple and obvious (and reasonably efficient) way to do things. I'm currently call time.Now().UTC() no more than a few thousand times per second and store

Re: [go-nuts] Data race in sql package

2022-07-21 Thread Steven Hartland
I'm guessing that Michal is flagging is there no way to write safe code if your using stmt.QueryContext(ctx) and rows.Scan into a sql.RawBytes as QueryContext kicks off a go routine that monitors the ctx, closing rows if cancelled and that ctx can be cancelled at any time. The only thing that spri

Re: [go-nuts] doc comment links to non-imported packages due to import cycles

2022-07-21 Thread Ian Lance Taylor
On Thu, Jul 21, 2022 at 11:42 AM TheDiveO wrote: > > Unfortunately, I cannot see how this is supposed to work with pkgsite. I > tried relative URLs, and these do not get recognized as valid links. So I > would need to hardwire the links to always refer to Google's pkgsite, which > defeats any d

Re: [go-nuts] Data race in sql package

2022-07-21 Thread Ian Lance Taylor
On Thu, Jul 21, 2022 at 11:02 AM Michal Hruby wrote: > > Hello, I have a code snippet equivalent to this one: > > rows, err := stmt.QueryContext(ctx) > if err != nil { > return info, nil, err > } > defer rows.Close() > > var data sql.RawBytes > for rows.Next() { > err = rows.Scan(&data) >

Re: [go-nuts] doc comment links to non-imported packages due to import cycles

2022-07-21 Thread TheDiveO
Unfortunately, I cannot see how this is supposed to work with pkgsite. I tried relative URLs, and these do not get recognized as valid links. So I would need to hardwire the links to always refer to Google's pkgsite, which defeats any different deployment and any host-local deployment while wor

[go-nuts] Data race in sql package

2022-07-21 Thread Michal Hruby
Hello, I have a code snippet equivalent to this one: rows, err := stmt.QueryContext(ctx) if err != nil { return info, nil, err } defer rows.Close() var data sql.RawBytes for rows.Next() { err = rows.Scan(&data) if err != nil { return nil, err } // if ctx is canceled ar

[go-nuts] [External] Differences between unmarshaling with encoding/json and encoding/protojson

2022-07-21 Thread 'Darius Tan' via golang-nuts
Hi all, Is there a comprehensive list of differences between how json.NewDecoder(r.Body).Decode(&req) and protojson.Unmarshal(req.Bytes(), pbObj) unmarshals JSON payloads? Switching from json.NewDecoder(r.Body).Decode(&req) to protojson.Unmarshal(req.Bytes(), pbObj) returned an error due to a

[go-nuts] Re: Is there a workflow engine written in GO

2022-07-21 Thread Crbala Subramanian
Hi All Is there any reference implementation of GUI based workflow engine similar to BPEL or Oracle OSM like No-code system built on golang. Thanks C.R.Bala On Friday, April 22, 2022 at 10:23:56 AM UTC+5:30 Ankush Thakur wrote: > As of 2022, Temporal is an amazing alternative: https://temporal

Re: [go-nuts] Re: Cannot instantiate T(ype) passed as pointer T?

2022-07-21 Thread 'Axel Wagner' via golang-nuts
The design doc says this: > What we need is a way to say that the type constraint applies to either > the pointer method set or the value method set. The body of the functio

Re: [go-nuts] Re: Cannot instantiate T(ype) passed as pointer T?

2022-07-21 Thread Slawomir Pryczek
Thanks, actually that's what I was looking for. Don't have much experience using generics (like 2 days) but looks rather inconvinient to do that. This pattern is convinient for you and you're using it in your code? You think there are plans to introducing some feature which will allow to work w