Re: [go-nuts] Generics: type-list vs method-based constraints -- not orthogonal?

2020-07-02 Thread Steven Blenkinsop
Passing in two type parameters, one which is the type used by the caller and one which implements the interface, would almost work if conversions were allowed between type parameters with the same underlying types: https://go2goplay.golang.org/p/ylchcyACuV7 You have to double parameterize

Re: [go-nuts] Generics: type-list vs method-based constraints -- not orthogonal?

2020-07-02 Thread Ben Hoyt
Thanks. You're right about the Map with the comparison function being more flexible. That helps allay my concerns for ordered data structures. I guess what I'm worried about is for someone writing a "slices" library and wants to include a function like slices.Smallest(). Do they give it an

Re: [go-nuts] Generics: type-list vs method-based constraints -- not orthogonal?

2020-07-02 Thread Ian Lance Taylor
On Thu, Jul 2, 2020 at 4:59 PM ben...@gmail.com wrote: > > This thread on lobste.rs made me wonder if the difference between type-list > constraints and method-interface constraints is going to cause a bunch of > issues or code duplication. There's a lack of orthogonality here that makes > me

Re: [go-nuts] maptype questions

2020-07-02 Thread Ian Lance Taylor
On Thu, Jul 2, 2020 at 5:34 PM arthurwil...@gmail.com wrote: > > On Monday, June 29, 2020 at 10:41:15 PM UTC-5 Ian Lance Taylor wrote: >> >> On Mon, Jun 29, 2020 at 6:33 PM arthurwil...@gmail.com >> wrote: >> > >> > On Monday, June 29, 2020 at 8:16:14 PM UTC-5 Ian Lance Taylor wrote: >> >> >> >>

Re: [go-nuts] maptype questions

2020-07-02 Thread arthurwil...@gmail.com
On Monday, June 29, 2020 at 10:41:15 PM UTC-5 Ian Lance Taylor wrote: > On Mon, Jun 29, 2020 at 6:33 PM arthurwil...@gmail.com > wrote: > > > > On Monday, June 29, 2020 at 8:16:14 PM UTC-5 Ian Lance Taylor wrote: > >> > >> On Mon, Jun 29, 2020 at 5:32 PM Bill Morgan > >> wrote: > >> >

[go-nuts] Generics: type-list vs method-based constraints -- not orthogonal?

2020-07-02 Thread ben...@gmail.com
Hi folks, This thread on lobste.rs made me wonder if the difference between type-list constraints and method-interface constraints is going to cause a bunch of issues or code duplication. There's a lack of orthogonality here that makes me

[go-nuts] go/build - how to locate source without making network calls?

2020-07-02 Thread James Lawrence
I've been playing with the go/build package for resolving go package information for a few projects of mine and noticed some unexpected behavior. mainly it seems to reach out to the network even when all the information is available locally. if I turn off my network my code fails whereas go

[go-nuts] Re: Go program getting SIGSEGV as it panics and runs down after a SIGTERM or a SIGINT signal

2020-07-02 Thread Charles Hathaway
Hey Steve, I'm no expert here, but the thing that sticks out to me is the garbage collection stacks in there, which suggests things are crashing while GC is running. Does the frequency change if you adjust the garbage collection frequency? Charles On Thursday, July 2, 2020 at 2:18:31 PM

[go-nuts] Go program getting SIGSEGV as it panics and runs down after a SIGTERM or a SIGINT signal

2020-07-02 Thread estess
We have developed a Go API (which we call a Go wrapper - https://pkg.go.dev/lang.yottadb.com/go/yottadb?tab=doc) to the YottaDB hierarchical key-value database (https://yottadb.com). It works well for the most part, but there are some edge cases during process shutdown that are standing

[go-nuts] No http.ServeStream() ?

2020-07-02 Thread Liam
Wondering why there's no http.ServeStream() API to do chunked transfer-encoding (or the http2 equivalent), in addition to the nice features of ServeContent()... Has it been considered? Does it merit a proposal? If not, some example code in the docs would be helpful... -- You received this

[go-nuts] proposal: Go 2: error handling: set error as return value by default from function

2020-07-02 Thread Александр Аверьянов
Set Error as return value by default from function Go 2 language change template: I am a novice Go programmer. I have also some experience with JS, Java, SQL.

[go-nuts] Why does html.UnescapeString not look for the trailing semicolon when finding HTML entities?

2020-07-02 Thread Akash
html.UnescapeString("Should this word, , be unescaped?") https://play.golang.org/p/vN5bvfooq8H Aren't HTML entities supposed to end with a semicolon? See https://developer.mozilla.org/en-US/docs/Glossary/Entity I couldn't see any edge cases mentioned in the source

Re: [go-nuts] godoc.org pkg.go.dev banner feedback

2020-07-02 Thread Russ Cox
Thanks for the feedback Jan. Google is on an extended holiday weekend for the US holiday but we'll definitely chase this down when people are back. Best, Russ On Thu, Jul 2, 2020 at 11:38 AM Jan Mercl <0xj...@gmail.com> wrote: > godoc.org displays packages from the domain modernc.org just

Re: [go-nuts] Is it necessary to start function names within main package with capitalized letter?

2020-07-02 Thread Jake Montgomery
On Wednesday, June 24, 2020 at 12:46:42 PM UTC-4, Axel Wagner wrote: > > Personally, I tend to do it. Note that it doesn't actually make a > difference from a technical perspective - main can't be imported, so it > makes no real sense to export any identifiers. > There is a case where main

[go-nuts] godoc.org pkg.go.dev banner feedback

2020-07-02 Thread Jan Mercl
godoc.org displays packages from the domain modernc.org just fine. It also adds a banner sayings, for example at https://godoc.org/modernc.org/cc/v3 "Pkg.go.dev is a new destination for Go discovery & docs. Check it out at pkg.go.dev/modernc.org/cc/v3 and share your feedback." However,