[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread Florin Pățan
Since everyone thinks it but nobody bothers to reply to it: this whole thing you propose can be currently done with a for loop, which not only is explicit about what it doing, but it also lets you control if you want to exit early from it and so on. Complicating the whole language because someth

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread mhhcbon
Sorry for this crime of thought, i was thinking it was a chance to talk about it and explore different paths. That, this, is the only answer, well, life is hard. Just for the records, i did stop thinking like that when i started golang, its not like you are given the choice. Psst ... I must ask

Re: [go-nuts] Re: How to parallelize text/template long running functions?

2017-06-02 Thread roger peppe
Here's a proof-of-concept of a somewhat general mechanism for making template functions concurrent. It involves some fun reflection code (first time I've used FuncOf, MakeFunc, StructOf and MapOf for real). https://play.golang.org/p/7qXx5pCh9N On 1 June 2017 at 07:02, Michael Brown wrote: > Gre

Re: [go-nuts] Re: How to parallelize text/template long running functions?

2017-06-02 Thread roger peppe
On 2 June 2017 at 10:35, roger peppe wrote: > Here's a proof-of-concept of a somewhat general mechanism > for making template functions concurrent. It involves some > fun reflection code (first time I've used FuncOf, MakeFunc, > StructOf and MapOf for real). > > https://play.golang.org/p/7qXx5pCh

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread Egon
On Friday, 2 June 2017 12:06:54 UTC+3, mhh...@gmail.com wrote: > > Sorry for this crime of thought, i was thinking it was a chance to talk > about it and explore different paths. > That, this, is the only answer, well, life is hard. > Thinking and discussion is helpful, but I think the format her

Re: [go-nuts] AI-first?

2017-06-02 Thread Rudi
On Thursday, June 1, 2017 at 11:17:42 PM UTC+2, Ian Lance Taylor wrote: > > On Thu, Jun 1, 2017 at 7:20 AM, > > wrote: > > > > I have a general question: > > > > I'd like to talk a little bit about how AI might be used to create > better > > computer programs. Some years ago there used to

[go-nuts] Re: Which Go client for ElasticSearch?

2017-06-02 Thread Lee Rick
i choose https://github.com/olivere/elastic, it works fine. 在 2015年11月5日星期四 UTC+8上午8:21:29,Peter Kleiweg写道: > > The website of ElasticSearch lists three Go clients: > > https://github.com/mattbaird/elastigo > > https://github.com/belogik/goes > > https://github.com/olivere/elastic > > Does anyone

[go-nuts] Golang, SQL and ORM avoidance techniques

2017-06-02 Thread brylant
I've been trying hard (well.. as much as I can considering my lack of in-depth go knowledge or - to be perfectly honest - lack of in-depth knowledge of anything) to find suitable go+sql technique that would not require a lot of code repetition, not use reflection and not use ORMs of any sort..

Re: [go-nuts] AI-first?

2017-06-02 Thread Rudi
Well, I deleted my original post before Ian replied because I anticipated his answer in advance. However, since you mentioned "confusion", I feel I want to clarify a bit what I am getting at: there is already a project out there called Milepost GCC, they do compiler optimizations using mach

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread gary . willoughby
Generics enable more than just replacing loops. For example, they can enable libraries of generic algorithms to be used with any type of array. Here's an example: foo := GetArray() result := foo.Take(10).map(...).Sort(...).Reduce(...) That is simple to understand and in one line of code. Imagin

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread Egon
On Friday, 2 June 2017 15:59:41 UTC+3, gary.wi...@victoriaplumb.com wrote: > > Generics enable more than just replacing loops. For example, they can > enable libraries of generic algorithms to be used with any type of array. > Here's an example: > > foo := GetArray() > result := foo.Take(10).map(

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread gary . willoughby
Right, now show me the contents of the *average wage by country *function! It's not going to be one line or as readable is it?!?! On Friday, 2 June 2017 14:26:47 UTC+1, Egon wrote: > > On Friday, 2 June 2017 15:59:41 UTC+3, gary.wi...@victoriaplumb.com wrote: >> >> Generics enable more than just

Re: [go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread Henrik Johansson
I have seen syntactic sugar like that in Scala. It can be very powerful but at the same time very confusing when you need to fix a bug since you have the mental overhead of the dsl to actual code to worry about as well. fre 2 juni 2017 kl 16:16 skrev : > Right, now show me the contents of the *a

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-02 Thread Egon
On Friday, 2 June 2017 17:16:09 UTC+3, gary.wi...@victoriaplumb.com wrote: > > Right, now show me the contents of the *average wage by country *function! > It's not going to be one line or as readable is it?!?! > You can try http://www.wolframalpha.com/, which is somewhat close to the principle.

[go-nuts] golang regex question

2017-06-02 Thread Sankar
I have a go string dbConnStr1 := "user=someone password=something host=superduperhost sslmode=something" the k=v pair in this string may be in any order, for example: dbConnStr2 := "host=superduperhost user=someone password=something" Notice the difference in the key order and also the missin

Re: [go-nuts] Re: How to parallelize text/template long running functions?

2017-06-02 Thread Michael Brown
Your solution is certainly nice. It has the same limitation that mine does. I'll take a look, I like how you don't have to modify the funcmap in yours. -- Michael On Friday, June 2, 2017 at 4:41:14 AM UTC-5, rog wrote: > > On 2 June 2017 at 10:35, roger peppe > > wrote: > > Here's a proof-of-co

[go-nuts] Re: golang regex question

2017-06-02 Thread pierre . curto
Hello, Try something like this: https://play.golang.org/p/xSEX1CAcQE Le vendredi 2 juin 2017 16:26:24 UTC+2, Sankar a écrit : > > I have a go string > > dbConnStr1 := "user=someone password=something host=superduperhost > sslmode=something" > > the k=v pair in this string may be in any order, f

Re: [go-nuts] Re: golang regex question

2017-06-02 Thread Sankar P
This is brilliant. I just never had the idea to split by words and accumulate them. Thanks. Please update the stackoverflow also with this answer if you have an account. Otherwise I will update it in stackoverflow tomorrow, crediting this mail thread as the source. 2017-06-02 21:39 GMT+05:30 : >

[go-nuts] Copy map with empty interfaces

2017-06-02 Thread Chun Zhang
I am trying to store some complicated data structure with a map, and eventually search and use it. Since the structure can change with different applications, and it has to work with multiple thread, I defined a generic map like follows type IndexedMap struct { sync.RWMutex Data

[go-nuts] [ANN] HTTP/2 Plaintext Server

2017-06-02 Thread Carl Mastrangelo
Hi all, If you have ever wanted to use the Go httputil.ReverseProxy with HTTP/2, or do HTTP/2 over Unix Domain Sockets, or do gRPC over plaintext, I made a package that makes it easy to do: https://github.com/carl-mastrangelo/h2c I added some examples to show how to do it, comments welcome!

[go-nuts] Minio cloud storage?

2017-06-02 Thread Jim Robinson
The https://www.minio.io/ project looks very interesting. It's an S3 compatible cloud storage server (and associated apis and command line clients), written in Go. Have any of you folks made use of it? Jim -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] Minio cloud storage?

2017-06-02 Thread Christian von Pentz
On 06/02/2017 11:36 PM, Jim Robinson wrote: > Have any of you folks made use of it? Indeed I have. So far only on a single node in the non-cluster mode but it worked very well and was a pleasure to setup and use. In fact it worked so well that I'll be moving a 16TB cluster from Riak-CS to minio in

[go-nuts] CGO & Plugins

2017-06-02 Thread dc0d
Assuming we have some *cgo* packages, is it fine to place them inside a plugin (added in Go 1.8)? It seems to ease deployment (on the same platform) and save some compilation time. But I'm not sure if it's safe to do so, mixing cgo & plugins. -- You received this message because you are subsc

[go-nuts] Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-02 Thread Ray Yang
Googled around for a while and found some libs in node.js for the same purpose, e.g. https://www.npmjs.com/package/query-to-mongo https://www.npmjs.com/package/mongo-querystring Is there anything similar available in golang? Thanks. -- You received this message because you are subscribed to t

Re: [go-nuts] CGO & Plugins

2017-06-02 Thread Ian Lance Taylor
On Fri, Jun 2, 2017 at 3:55 PM, dc0d wrote: > > Assuming we have some cgo packages, is it fine to place them inside a plugin > (added in Go 1.8)? > > It seems to ease deployment (on the same platform) and save some compilation > time. But I'm not sure if it's safe to do so, mixing cgo & plugins.

Re: [go-nuts] CGO & Plugins

2017-06-02 Thread Michael Brown
Do you have any references on the stability of the current plugin system that I can use for reference? I'm building a system now that I contemplate using with some plugins and I'd like to know up front the challenges. On Friday, June 2, 2017 at 7:39:40 PM UTC-5, Ian Lance Taylor wrote: > > On Fr

[go-nuts] filago: Monitor a Linux process' opening and closing of files, including Unix pipes and sockets

2017-06-02 Thread Glen Newton
Monitor open files (via /proc/pid) of a process. Lists time when it first sees the file open (which may be later than when the file actually opened, especially at startup of filago), and when it is no longer open. Stop running when target process ends. This includes anon_inode and tcp and uni

[go-nuts] Copy map with empty interfaces

2017-06-02 Thread Tamás Gulácsi
How is cgo involved here? What kind of keys are you using? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more opti