Re: [go-nuts] Re: vendoring related question/issue

2021-06-17 Thread Sachin Puranik
Dear Gophers, I have some more thoughts about the vendoring issue I observed earlier. Preface : Basically while vendoring other than go files, nothing is copied in the vendor folder(except the embed package). It can be some Readme.MD, or some text file, or HTML templates. Issue Details: In the

Re: [go-nuts] unexpected stuck in sync.(*Pool).Get()

2021-06-17 Thread Robert Engels
You’re right. Inspecting the code it is internally partitioned by P. I agree that it looks like the pool is being continually created. > On Jun 17, 2021, at 12:18 PM, Ian Lance Taylor wrote: > > On Thu, Jun 17, 2021 at 9:19 AM Peter Z wrote: >> The original post is on stackoverflow >>

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Bakul Shah
On Jun 17, 2021, at 1:20 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Thu, Jun 17, 2021 at 9:43 AM Joshua wrote: > >> 1) I'm modelling a data type which has a field which may or may not be >> there, would most Gophers reach for a pointer here, and use `nil' to >> represent a missing

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Joshua
Thanks a lot for the thoughts everyone, I will take all your suggestions under advisement. Jan: Thanks for the tips for performance, however with this project I'm not particularly trying to squeeze as much performance as possible, and I prefer the "safety" of the otherway. I mean safe in that,

Re: [go-nuts] unexpected stuck in sync.(*Pool).Get()

2021-06-17 Thread Ian Lance Taylor
On Thu, Jun 17, 2021 at 10:11 AM Robert Engels wrote: > > You probably need multiple pools in and partition them. 500k accessors of a > shared lock is going to have contention. That might well help, but note that sync.Pool does not have a shared lock in general use. The shared lock is only

Re: [go-nuts] unexpected stuck in sync.(*Pool).Get()

2021-06-17 Thread Ian Lance Taylor
On Thu, Jun 17, 2021 at 9:19 AM Peter Z wrote: > > The original post is on stackoverflow > https://stackoverflow.com/questions/67999117/unexpected-stuck-in-sync-pool-get > > Golang ENV: > go1.14.3 linux/amd64 > > Description: > We have about half a million agents running on each of our

Re: [go-nuts] unexpected stuck in sync.(*Pool).Get()

2021-06-17 Thread Robert Engels
You probably need multiple pools in and partition them. 500k accessors of a shared lock is going to have contention. github.com/robaho/go-concurrency-test might be helpful. > On Jun 17, 2021, at 11:19 AM, Peter Z wrote: > >  > The original post is on stackoverflow >

[go-nuts] unexpected stuck in sync.(*Pool).Get()

2021-06-17 Thread Peter Z
The original post is on stackoverflow https://stackoverflow.com/questions/67999117/unexpected-stuck-in-sync-pool-get Golang ENV: go1.14.3 linux/amd64 Description: We have about half a million agents running on each of our machines.The agent is written in Go. Recently we found that the

[go-nuts] how to consume API using Golang

2021-06-17 Thread Asim Shahzad
Please anyone guide me that how to consume API using Golang with user name and password? This is the API address https://emea.universal-api.pp.travelport.com/B2BGateway/connect/uAPI/ AirService if have to pass the following with request request.Headers.Add("Authorization", "Basic " +

[go-nuts] New article: Scalable event streaming with Redis and Golang

2021-06-17 Thread Ramiro Nuñez Dosio
Learn how to build a scalable infrastructure for streaming large amounts of traffic easily to clients: Scalable event streaming with Redis and Golang -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Brian Candler
On Thursday, 17 June 2021 at 09:02:48 UTC+1 axel.wa...@googlemail.com wrote: > >> How would you go about modelling this type in Go? >> > > Either using an interface, or by having two pointer-fields and only > setting one. > I'd just add for clarity: in Go an interface value is also something

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Jan Mercl
On Thu, Jun 17, 2021 at 9:43 AM Joshua wrote: > 1) I'm modelling a data type which has a field which may or may not be >there, would most Gophers reach for a pointer here, and use `nil' to >represent a missing value? That's the usual approach seen in the wild and IMO often the wrong

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Amit Saha
On 17 Jun 2021, at 5:43 pm, Joshua wrote: Hello, I have 2 questions about idiomatic ways to represent optional values, and variant values in types. 1) I'm modelling a data type which has a field which may or may not be there, would most Gophers reach for a pointer here, and use `nil' to

Re: [go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread 'Axel Wagner' via golang-nuts
On Thu, Jun 17, 2021 at 9:43 AM Joshua wrote: > Hello, > > I have 2 questions about idiomatic ways to represent optional values, > and variant values in types. > > 1) I'm modelling a data type which has a field which may or may not be >there, would most Gophers reach for a pointer here, and

[go-nuts] Representing Optional/Variant Types Idiomatically (or not)

2021-06-17 Thread Joshua
Hello, I have 2 questions about idiomatic ways to represent optional values, and variant values in types. 1) I'm modelling a data type which has a field which may or may not be there, would most Gophers reach for a pointer here, and use `nil' to represent a missing value? 2) Another field