Re: [go-nuts] [generics] type list should not pass newtypes

2020-06-27 Thread Ian Lance Taylor
On Sat, Jun 27, 2020 at 3:06 PM tdakkota wrote: > > I think, if I want int/[]int, I should use int/[]int or just declare a domain > specific alias. > MyInt/[]MyInt should implement Lesser/Min/etc interface. It can declare > specific comparison rules. > > Min implementation can be like: https://g

[go-nuts] Re: go.pkg.dev missing golang packages

2020-06-27 Thread Jonathan Amsterdam
You can open an issue on the Go issue tracker. Use this link: https://golang.org/s/discovery-feedback. I filed https://golang.org/issue/39894. On Saturday, June 27, 2020 at 1:20:15 PM UTC-4, Steve Roth wrote: > > I understand that some Go package documentation is not documented on > go.pkg.dev

Re: [go-nuts] [generics] type list should not pass newtypes

2020-06-27 Thread tdakkota
I think, if I want int/[]int, I should use int/[]int or just declare a domain specific alias. MyInt/[]MyInt should implement Lesser/Min/etc interface. It can declare specific comparison rules. Min implementation can be like: https://go2goplay.golang.org/p/Fgo2fJAlKXD (this code does not compile

Re: [go-nuts] [generics] type list should not pass newtypes

2020-06-27 Thread Ian Lance Taylor
On Sat, Jun 27, 2020 at 12:35 PM a b wrote: > > Newtype is a expression like > type MyInt int > > It's not the same type as int, so why it's permitted? > In Go1 you must perform explicit conversion. Because if you have a []MyInt, it would be nice to be able to pass that to a function like slices.

Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread Ian Lance Taylor
On Sat, Jun 27, 2020 at 10:46 AM Tyler Compton wrote: > > This topic has been discussed many times on this list, so it's probably best > to look at and post in one of those threads. Let me take this chance to > collect as much information about this issue as I can in a single post. > Unfortunate

Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread t hepudds
Hi Tyler, I just wanted to say a quick thank you for pulling those references together and your thoughtful response in this thread. Hopefully the time you spent doing that will help additional gophers as the generics discussion continues on this list. Regards, thepudds -- You received this

Re: [go-nuts] Re: Graphic Go Algorithms: Graphically learn data structures and algorithms better than before

2020-06-27 Thread tim Hu
German user please try this link: https://www.amazon.de/dp/B08BFXNTFF Have a nice day. 在 2020年6月26日星期五 UTC+6上午11:42:47,Christian Staffa写道: > > it seems not to be available for germany users 🤬 > > Sent from my iPhone > > On 25. Jun 2020, at 21:20, Yesudeep Mangalapilly > wrote: > >  > Hey, than

[go-nuts] [generics] type list should not pass newtypes

2020-06-27 Thread a b
Newtype is a expression like type MyInt int It's not the same type as int, so why it's permitted? In Go1 you must perform explicit conversion. For example, type Float interface { type float32, float64 } func NewtonSqrt(type T Float)(v T) T { var iterations int switch (interface{})(v).(type) {

Re: [go-nuts] [generics] Syntax feedback

2020-06-27 Thread Tyler Compton
Hi Rob, This topic has been discussed many times on this list, so it's probably best to look at and post in one of those threads. Let me take this chance to collect as much information about this issue as I can in a single post. Unfortunately, discoverability can sometimes be hard on mailing lists

[go-nuts] go.pkg.dev missing golang packages

2020-06-27 Thread Steve Roth
I understand that some Go package documentation is not documented on go.pkg.dev for licensing reasons. However, I would not have expected that packages maintained by the Go team itself would have such problems. Yesterday I discovered, for example, that the documentation for github.com/golang/freet

Re: [go-nuts] Re: Speed up png.Decode

2020-06-27 Thread David Riley
On Jun 27, 2020, at 8:30 AM, Robert Engels wrote: > > Just because the bulk of the time is in the decode doesn’t mean the decode is > inefficient or can be improved upon. It might be the most expensive stage in > the process regardless of the implementation. This is I think the most important

Re: [go-nuts] Re: Speed up png.Decode

2020-06-27 Thread Michael Jones
An easy "comfort" exercise: save 1000 images to a directory in png form. decode with go and with several tools such as imagemagick compare times for format in jpeg, tiff, ... convert all images to that format; do the test above anew the result will be a comparison chart of Go existing image deco

[go-nuts] [generics] Syntax feedback

2020-06-27 Thread Rob Reid
Hi team, I wanted to provide some feedback on the syntax used in the generics proposal. When I first opened the Go 2 playground, it took me a while to realise that (type T) was a generic parameter and not a function parameter and that (s []T) was a function parameter and not a return parameter):

Re: [go-nuts] Re: Speed up png.Decode

2020-06-27 Thread Robert Engels
Just because the bulk of the time is in the decode doesn’t mean the decode is inefficient or can be improved upon. It might be the most expensive stage in the process regardless of the implementation. > On Jun 27, 2020, at 12:15 AM, Lee Armstrong wrote: > >  > Thanks Rob, > > Yes you are ri

[go-nuts] Re: [generics] I think it's better have higher perfomance than lower compiling time

2020-06-27 Thread Viktor Kojouharov
I seem to recall that the compilation time of C (and C++) programs is directly proportional to the number of includes your program has. I'm sure that monomorphisation in C++ exacts some kind of cost to the compilation time, but perhaps it's not as much as people seem to think. On Friday, June

[go-nuts] Go, git and github questions

2020-06-27 Thread Joe McGuckin
1). When I use ‘go get’ to download some source code from github, is the src directory a regular ‘git’ directory? 2).i want to download some go code from github and make a bunch of local changes. Just ‘go get’ and start editing? Nothing else I need to do? Thanks -- You received this message b

[go-nuts] for learn GoCV, I make simple RPA tool.

2020-06-27 Thread 加藤泰隆
for learn GoCV, I make simple RPA tool. Probably, As far as I know, This is the one single file RPA tool. https://github.com/yasutakatou/rabbitRPA I would like to know if you have any ideas about the following. 1. for create one file, used statik.(https://github.com/rakyll/statik) Therefore, whe

[go-nuts] Re: defer func() { _ = resp.Body.Close() }()

2020-06-27 Thread Amnon
Apologies for replying to an old post. But I am sometimes a bit slow in reading my messages. I too think that errcheck's is a bit severe in its treatment of deferred calls to Close(). So I forked the code and changed the behaviour to be more permissive. https://github.com/amnonbc/errcheck Feel