Re: [go-nuts] Client Cipher Order Preference not being honored with golang 1.17+

2022-08-29 Thread 'Diana Tuck' via golang-nuts
Thank you for the additional context. I indeed missed that TLS_RSA_WITH_AES_128_GCM_SHA256 was listed in the InsecureCipherSuites. I also found the comment above cipherSuitesPreferenceOrder to be missing some pertinent information, but the blog post does clear that up. Thank you for sharing tha

Re: [go-nuts] Taking single value from multi-return function and inlining function calls

2022-08-29 Thread Aaron Rubesh
Another option for this is if your function is always called after the call to the external library, you can change your function signature to match the return value of the external library. Its quite common to see something like this: ` func A() (int, error) {} func UseA(a int, err error) (in

Re: [go-nuts] Taking single value from multi-return function and inlining function calls

2022-08-29 Thread 'Axel Wagner' via golang-nuts
You could write helpers: func Left[A, B any](a A, b B) A { return a } func Right[A, B any](a A, b B) B { return b } Which you can then insert useOne(Left(returnMany()) useOne(Right(returnMany()) But TBQH, I would not consider this good style. It ultimately adds more noise and overhead, as peopl

[go-nuts] Taking single value from multi-return function and inlining function calls

2022-08-29 Thread Tanmay Das
Hi, I am relatively new to the Go language, and I have always wanted to ask this question: Consider the following snippet: package main import "fmt" func returnMany() (int, int) { return 4, 2 } func useOne(value int) { fmt.Println(value) } func main() { useOne(returnMany()) } T