Re: [go-nuts] UML && Golang, part 2 ?

2021-11-15 Thread alex-coder
After all, I found that plantuml is more suitable for code visualization. If anyone is interested, you will find it there: https://plantuml.com/ Thank all for participation. суббота, 13 ноября 2021 г. в 19:43:20 UTC+3, alex-coder: > Satyendra, > >> https://github.com/ofabry/go-callvis > > very

[go-nuts] Nested structure

2021-11-15 Thread Денис Мухортов
Hello everyone, there is a small problem how to get the total price field from the Order structure? type Order struct { OrderUID string `json:"order_uid"` Entry string `json:"entry"` InternalSignature string `json:"internal_signature"` Payment Paym

[go-nuts] Re: Nested structure

2021-11-15 Thread Brian Candler
You can't get a *value* out of a *type*. However if you have a *variable* of type Order, e.g. var o Order then you could do for example: o.Items[0].TotalPrice to get the TotalPrice of the first item. Note: it would be conventional to have "type Item" rather than "type Items", because this ty

Re: [go-nuts] Go http/2 implementation is x5 less per performant than http/1.1

2021-11-15 Thread Kevin Chowski
These are interesting results, thanks for investigating and sharing results! I see that you have mostly been focusing on throughput in your posts, have you done testing for latency differences too? On Saturday, November 13, 2021 at 6:11:40 PM UTC-7 ren...@ix.netcom.com wrote: > As another data

Re: [go-nuts] Go http/2 implementation is x5 less per performant than http/1.1

2021-11-15 Thread Robert Engels
Since http2 multiplexes streams it will delicately affect latency on other streams. This is why I suggested using multiple transports - one for high throughput transfers and another for lower latency “interactive” sessions. > On Nov 15, 2021, at 9:23 AM, Kevin Chowski wrote: > > These are in

[go-nuts] Amateur question: when you should use runes?

2021-11-15 Thread Kamil Ziemian
Hello, I read quite a few blog posts, articles, listen to nice number to talks about strings, runes and encoding in Go. I now reading Go Language Spec and I just stuck in the section about runes. I mean, it isn't hard as itself, but it raises to much questions to me. I decided that I need to le

Re: [go-nuts] Amateur question: when you should use runes?

2021-11-15 Thread Robert Engels
When your string contains Unicode characters dealing with it as individual bytes is difficult. When using runes with range - each index is a “Unicode character” (which may be multiple bytes) - which is easy to use. See go.dev/blog/strings > On Nov 15, 2021, at 12:00 PM, Kamil Ziemian wrote:

Re: [go-nuts] Amateur question: when you should use runes?

2021-11-15 Thread burak serdar
On Mon, Nov 15, 2021 at 11:00 AM Kamil Ziemian wrote: > Hello, > > I read quite a few blog posts, articles, listen to nice number to talks > about strings, runes and encoding in Go. I now reading Go Language Spec and > I just stuck in the section about runes. I mean, it isn't hard as itself, > bu

Re: [go-nuts] Amateur question: when you should use runes?

2021-11-15 Thread Sachin Raut
On Tue, Nov 16, 2021 at 12:38 AM burak serdar wrote: > > > On Mon, Nov 15, 2021 at 11:00 AM Kamil Ziemian > wrote: > >> Hello, >> >> I read quite a few blog posts, articles, listen to nice number to talks >> about strings, runes and encoding in Go. I now reading Go Language Spec and >> I just st

[go-nuts] Getting "cgo argument has Go pointer to Go pointer"

2021-11-15 Thread David Karr
I'm pretty new to Go (many years in other languages). I'm trying to use cgo to use a C library we're using. I have the following line of code, which is compiling (that's been enough of a struggle): status = int(C.VeProtect(C.VeObj(fpeProtect), &argsProtect)) This is failing at runtime with

[go-nuts] Re: Getting "cgo argument has Go pointer to Go pointer"

2021-11-15 Thread David Karr
On Monday, November 15, 2021 at 3:49:20 PM UTC-8 David Karr wrote: > > I'm pretty new to Go (many years in other languages). I'm trying to use > cgo to use a C library we're using. > > I have the following line of code, which is compiling (that's been enough > of a struggle): > > status = int(C

Re: [go-nuts] Getting "cgo argument has Go pointer to Go pointer"

2021-11-15 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2021-11-15 at 15:06 -0800, David Karr wrote: > > I'm pretty new to Go (many years in other languages). I'm trying to > use cgo to use a C library we're using. > > I have the following line of code, which is compiling (that's been > enough of a struggle): > > status = int(C.VeProtect(C.

[go-nuts] why remove response header "Connection: Close" automatically?

2021-11-15 Thread chen...@gmail.com
hi guys, When i was doing a http api performance benchmark, i found a lot of connections of status of "TIME_WAIT". I have tried to change the value of Transport.MaxConnsPerHost, but still not working. After a long time debuging, i finally found that api response header contains " Connection: c

[go-nuts] Go2 Playground and constraints package

2021-11-15 Thread Johann Höchtl
The example from https://github.com/mattn/go-generics-example/blob/main/constraints-chan/main.go does not work with the Go2 Playground https://go2goplay.golang.org/p/Is-IieENirk as the constraints package is not available. I didn't find any mention on that on the Internets, is this a known limita

Re: [go-nuts] Go2 Playground and constraints package

2021-11-15 Thread 'Axel Wagner' via golang-nuts
The go2go playground is basically obsolete, as it is based on the prototype implementation, instead of gotip. You can use https://gotipplay.golang.org/ which provides a playground based on gotip. Though the example does not work there either, as `constraints.Chan` has been removed after https://git