Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread matthewjuran
Slice pointer keys are another option but that concept is tricky too. Matt On Tuesday, February 6, 2018 at 3:34:54 AM UTC-6, rog wrote: > > ... tick, tick, tick, tick... dide-dudi-diddlidedum...di! > > func comparable(xs []int) interface{} { > type elem struct { >

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-02-06 Thread Sina Siadat
Thanks for the link! On Mon, Feb 5, 2018 at 4:22 PM Aliaksandr Valialkin wrote: > > > On Tuesday, January 30, 2018 at 12:43:38 AM UTC+2, Sina Siadat wrote: >> >> Hi Sebastien, >> >> ​Thanks for your comment and question :) >> >> > I have one "drive-by-comment" and a question:

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread Peter Waller
On 6 February 2018 at 09:34, roger peppe wrote: > ... tick, tick, tick, tick... dide-dudi-diddlidedum...di > http://www.reactiongifs.com/wp-content/uploads/2011/09/mind_blown.gif -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread roger peppe
... tick, tick, tick, tick... dide-dudi-diddlidedum...di! func comparable(xs []int) interface{} { type elem struct { first int rest interface{} } var r interface{} for _, x := range xs { r = elem{x, r} }

Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread andrey mirtchovski
$ go test -c os/signal $ ./signal.test PASS $ go tool dist test -v # Testing packages. # go tool dist test -run=^go_test:archive/tar$ [...] ok net/url (cached) ok os 0.677s ok os/exec 1.414s --- FAIL: TestTerminalSignal (5.01s) signal_cgo_test.go:138: "PS1='prompt> '\r\n"

[go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread andrey mirtchovski
I'm trying to understand why os/signal tests fail on my 10.12 macbook pro at tip: $ ./all.bash [...] ok net/textproto (cached) ok net/url (cached) ok os 0.678s ok os/exec 1.185s --- FAIL: TestTerminalSignal (5.01s) signal_cgo_test.go:138: "PS1='prompt> '\r\n" signal_cgo_test.go:163: timed out

Re: [go-nuts] osx 10.12 all.bash weirdness with os/signal tests

2018-02-06 Thread Ian Lance Taylor
On Tue, Feb 6, 2018 at 2:54 PM, andrey mirtchovski wrote: > $ go test -c os/signal > $ ./signal.test > PASS > $ go tool dist test -v > > # Testing packages. > # go tool dist test -run=^go_test:archive/tar$ > [...] > ok net/url (cached) > ok os 0.677s > ok os/exec

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread matthewjuran
I went ahead and opened a Go 2 proposal: https://github.com/golang/go/issues/23725 Thanks, Matt On Tuesday, February 6, 2018 at 3:26:15 PM UTC-6, matthe...@gmail.com wrote: > > What do you mean by a "slice pointer key" ? > > > map[*[]Something]string > > Then map consumers can do key

[go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-06 Thread matthewjuran
> > Your visitor pattern here seems to not be a "visitor" pattern. I would > think that the Go equivalent would define an interface, and visit based on > that interface. Here’s what the Wikipedia article says: In essence, the visitor allows adding new virtual functions to a family of >

[go-nuts] Differentiating between reader and writer errors

2018-02-06 Thread Justin Azoff
Hi! I have a simple service that has an API for searching things like log files. One of the API endpoints returns just the matching documents, while another will try to return the matching records from those documents. Because this output could be quite large (and so that results stream) I

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread matthewjuran
> > What do you mean by a "slice pointer key" ? map[*[]Something]string Then map consumers can do key comparisons. I originally used this for an unordered set type. Matt On Tuesday, February 6, 2018 at 11:12:06 AM UTC-6, rog wrote: > > On 6 February 2018 at 14:55,

[go-nuts] Struct literal in condition of if statement yields compile error

2018-02-06 Thread Patrick Smith
See https://play.golang.org/p/cO4LQFk7ew- Given a struct definition type S struct { a, b int } an if statement of the form if x == S{ 0, 1 } { ... } yields compile errors such as prog.go:19:18: syntax error: unexpected }, expecting := or = or comma prog.go:22:1: syntax error: non-declaration

Re: [go-nuts] Struct literal in condition of if statement yields compile error

2018-02-06 Thread Jan Mercl
On Tue, Feb 6, 2018 at 10:31 PM Patrick Smith wrote: > Obviously I can code around this, but is it a bug that should be reported? Not a bug. See https://golang.org/ref/spec#Composite_literals A parsing ambiguity arises when a composite literal using the TypeName

Re: [go-nuts] Struct literal in condition of if statement yields compile error

2018-02-06 Thread Patrick Smith
On Tue, Feb 6, 2018 at 1:37 PM, Jan Mercl <0xj...@gmail.com> wrote: > > Not a bug. See https://golang.org/ref/spec#Composite_literals > > > > A parsing ambiguity arises when a composite literal using the TypeName > form of the LiteralType appears as an operand between the keyword >

[go-nuts] Re: Any interest for an online "Go programming" degree ?

2018-02-06 Thread Trig
There are already so many good courses available out there, and most employers either do white-boarding, a coding challenge, or want to see some existing code on a public repo such as Github.com. So, IMHO... even with a 'certificate' or 'degree', that would likely not change these

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread roger peppe
On 6 February 2018 at 14:55, wrote: > Slice pointer keys are another option but that concept is tricky too. What do you mean by a "slice pointer key" ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Debug high GC pause frequency issue

2018-02-06 Thread Bob Cao
Hi Lan I have used memory profiler and CPU profiler. The CPU profiler told me that the program is spending a lot of time doing GC (obviously), and memory profiler is telling me there is a huge amount of memory allocated for json encoding/decoding, which is inevitable for business logic. And

[go-nuts] gin webserver - how to get name of root xml node

2018-02-06 Thread desaiabhijit
Have XML End point - want to capture and validate xml Root Element of the request r.POST("/endpoint", func(c *gin.Context) { // capture and validate if Root Element is correct // if I use c.Request.Body buffer then c.Bind() will not get data if c.Bind() == nil {

Re: [go-nuts] GOTCHA: Just when you think you understand interfaces

2018-02-06 Thread Linker
Hi,Chris! You can try this: https://play.golang.org/p/KG4nE2nPvnN tmp2 = []Useable{tmpType(1),tmpType(2)} On Thu, Feb 1, 2018 at 1:37 AM, Chris Hopkins wrote: > Hi > Sharing my ignorance: > I didn't realise that although you can switch-case on an interface, an > array of

[go-nuts] Differentiating between reader and writer errors

2018-02-06 Thread Tamás Gulácsi
backend.FilterIPs should return differentiable error - whether this is a transient or a permanent error. I'd use github.com/pkg/errors: var ErrTransient = errors.New("transient error") ... func FilterIPs(...) error { if err != nil && err.IsTemporary() { return errors.Wrap(ErrTransient,

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-06 Thread theckman via golang-nuts
Hey Gregg I think that would make it more clear and looks great. I wouldn't want to take credit for your copy, but I'd be happy to open an issue / PR with this change. I'm not sure how to best attribute it to you. Cheers! -Tim On Monday, February 5, 2018 at 2:35:47 PM UTC-8, Gregg Townsend

[go-nuts] Re: gobot and raspberry pi

2018-02-06 Thread Ron Evans
Hi, JM I'm the maintain of Gobot. Also of GoCV, a Go package for computer vision, which might be a better option for you here. With GoCV as you can just use a couple of normal usb webcams, which would likely be a cheaper option, as well. You can find info about GoCV at https://gocv.io Let me

Re: [go-nuts] Question about the spec: Method Sets and Pointer Receivers

2018-02-06 Thread gtownsend
Please go ahead, Tim. I’m not really worried about credit for one sentence. You can mention me in the comments if you’d like. Gregg On Tuesday, February 6, 2018 at 1:11:10 AM UTC-7, thec...@netflix.com wrote: > > Hey Gregg > > I think that would make it more clear and looks great. I wouldn't

[go-nuts] Re: EOF during http.Client.Do()

2018-02-06 Thread rampantdurandal
I am seeing this as well when connecting to haproxy 1.8 locally. About 1 in 1000 requests. They all seem to have the "Connection: Close" header FWIW. The backends behind haproxy never see the request. On Thursday, February 20, 2014 at 6:23:13 PM UTC-8, freeformz wrote: > > I send a lot of data

[go-nuts] Debug high GC pause frequency issue

2018-02-06 Thread Bob Cao
I have a program whose GC pause frequency will quickly go from 40 calls per minute to 2000 calls per minute in a matter of hours, and the issue is kind of random on production. Is there any advice on how to spot the cause of the issue? -- You received this message because you are subscribed

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2018-02-06 Thread Ian Lance Taylor
On Tue, Feb 6, 2018 at 1:34 AM, roger peppe wrote: > ... tick, tick, tick, tick... dide-dudi-diddlidedum...di! > > func comparable(xs []int) interface{} { > type elem struct { > first int > rest interface{} > } > var r

Re: [go-nuts] Debug high GC pause frequency issue

2018-02-06 Thread Ian Lance Taylor
On Tue, Feb 6, 2018 at 12:58 AM, Bob Cao wrote: > > I have a program whose GC pause frequency will quickly go from 40 calls per > minute to 2000 calls per minute in a matter of hours, and the issue is kind > of random on production. > > Is there any advice on how to spot