Re: [go-nuts] I want to set the position of the window in GUI display of golang

2018-12-04 Thread Robert Engels
You should probably file an issue at http://github.com/lxn/walk They don’t seem to have a community forum, but I think the author could help you easily. Also you could try stack overflow as there are a few questions about this library there. > On Dec 4, 2018, at 7:44 PM, mdi.k...@gmail.com w

[go-nuts] I want to set the position of the window in GUI display of golang

2018-12-04 Thread mdi . kato
Hi I'm Japanese, so sorry if my English is wrong. I'm try to display GUI window with WALK(github.com/lxn/walk). But there is a problem dose not go well. If you run this code, maybe the window displayed upper left of screen. I want to set the position of the window in center of screen. What should

Re: [go-nuts] Re: keep working on concurent pipe

2018-12-04 Thread Burak Serdar
On Tue, Dec 4, 2018 at 5:54 PM Alex Dvoretskiy wrote: > > Thanks. > One question, we do "defer close(out)", but we don't close "in" channel. Why > garbage collector don't remove "out" channel? We don't write nothing to it in > function 3. So it should be empty. closing a channel sends a signal

[go-nuts] Re: keep working on concurent pipe

2018-12-04 Thread Alex Dvoretskiy
Thanks. One question, we do "defer close(out)", but we don't close "in" channel. Why garbage collector don't remove "out" channel? We don't write nothing to it in function 3. So it should be empty. On Tuesday, December 4, 2018 at 3:52:45 PM UTC-8, Alex Dvoretskiy wrote: > > I'm getting "fatal er

[go-nuts] GitHub Golang color

2018-12-04 Thread littleheart
Hello, I opened an pull request on https://github.com/github/linguist to improve Golang color on GitHub: Improve Golang color #4331 The actual color (#375EAB) doesn't fit to the official Golang's color ( #00ADD8) according to Golang's style guide <

Re: [go-nuts] build go in Intellij

2018-12-04 Thread robert engels
I also get errors like: even though the strings package shows a being imported correctly. > On Dec 4, 2018, at 6:37 PM, robert engels wrote: > > Hi, anyone on the list know how, or can point me to documentation, on > building Go itself in Intellij? > > By that I mean, I want to make changes

[go-nuts] build go in Intellij

2018-12-04 Thread robert engels
Hi, anyone on the list know how, or can point me to documentation, on building Go itself in Intellij? By that I mean, I want to make changes to the standard lib, or tools (specifically trace), and just compile that tool, tests, etc, work in Intellij. Right now, when I fork golang/go and open in

Re: [go-nuts] keep working on concurent pipe

2018-12-04 Thread Burak Serdar
On Tue, Dec 4, 2018 at 4:52 PM Alex Dvoretskiy wrote: > > I'm getting "fatal error: all goroutines are asleep - deadlock! on this code. > > Why? > > https://play.golang.org/p/KgJKu96PF7Q close(out) when a task ends. Also, you don't need to pass wg to the goroutine: https://play.golang.org/p/0K

[go-nuts] keep working on concurent pipe

2018-12-04 Thread Alex Dvoretskiy
I'm getting "fatal error: all goroutines are asleep - deadlock! on this code. Why? https://play.golang.org/p/KgJKu96PF7Q -- 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

[go-nuts] Re: concurent pipe

2018-12-04 Thread Alex Dvoretskiy
Thanks, Burak. Great explanation! On Tuesday, December 4, 2018 at 10:57:03 AM UTC-8, Alex Dvoretskiy wrote: > > Hi Golangnuts, > > I'm trying to implement kind of pipe function, using channels > > Do you think this would be a correct conception: > > func Pipe(fs ...task) { > > ch1 := make(chan int

Re: [go-nuts] Generic function aliases

2018-12-04 Thread 'Axel Wagner' via golang-nuts
This was considered (or rather, the `func g = f` syntax), but ultimately it was decided that the current ways to forward functions are good enough :) Either use var, or if you are uncomfortable with having that *theoretically* mutable, wrap it directly (it should get inlined, so there's no cost apa

[go-nuts] how to convert or typecast windows handle/fd to net.conn

2018-12-04 Thread apmattil
Hi My problem is following: I need to use windows WSAAccept() instead of normal accept (net package seems to use AcceptEx). I'm I missing somethig I do not know a way to extend net-package so only way I know is to use reflect to get the listener Sysfd (I know .. really bad, other options ?)

Re: [go-nuts] Documentation/tutorials on building and including precompiled .syso files in packages

2018-12-04 Thread lakk . jl
Thank you very much! -- 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 options, visit https://groups.google.com/d

Re: [go-nuts] concurent pipe

2018-12-04 Thread Burak Serdar
On Tue, Dec 4, 2018 at 11:57 AM Alex Dvoretskiy wrote: > > Hi Golangnuts, > > I'm trying to implement kind of pipe function, using channels > > Do you think this would be a correct conception: > > func Pipe(fs ...task) { > > ch1 := make(chan interface{}) > ch2 := make(chan interface{}) > > for _,

Re: [go-nuts] Generic function aliases

2018-12-04 Thread Liam Breck
I meant this should work https://play.golang.org/p/w6MBzP9RNdH On Tue, Dec 4, 2018, 11:21 AM messju mohr Erm, function names may be const, but functions are first class citizen > types and can of course be assigned to variables and be passed around. > > just my 2c > > On Tue, Dec 04, 2018 at 10:

Re: [go-nuts] Generic function aliases

2018-12-04 Thread messju mohr
Erm, function names may be const, but functions are first class citizen types and can of course be assigned to variables and be passed around. just my 2c On Tue, Dec 04, 2018 at 10:27:19AM -0800, Liam Breck wrote: >Ah yes, var works. But it should be const, since func names aren't >varia

[go-nuts] concurent pipe

2018-12-04 Thread Alex Dvoretskiy
Hi Golangnuts, I'm trying to implement kind of pipe function, using channels Do you think this would be a correct conception: func Pipe(fs ...task) { ch1 := make(chan interface{}) ch2 := make(chan interface{}) for _, f := range fs { ch1, ch2 = ch2, ch1 go f(ch1, ch2) } } Can you also explai

Re: [go-nuts] Generic function aliases

2018-12-04 Thread Liam Breck
Ah yes, var works. But it should be const, since func names aren't variables. On Tue, Dec 4, 2018, 5:40 AM Axel Wagner You can use > var Gi = g.G(int) > or you can use > func Gi(i int) error { return g.G(i) } > for the same effect. Which is pretty much the reason why > alias-declarations ended up

Re: [go-nuts] Documentation/tutorials on building and including precompiled .syso files in packages

2018-12-04 Thread jclc via golang-nuts
Thank you very much! -- 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 options, visit https://groups.google.com/d

[go-nuts] Is it possible with go modules to `go get` the ref (not the SHA) of an GitHub PR?

2018-12-04 Thread mark
I have a private github repository that depends on an open source github repository. There's an open PR in the open source repo, and I'd like to `go get` that change to test it locally in my private repo. Normally, when I update the open source repository, I can just run `go get github.com/MY_O

Re: [go-nuts] Documentation/tutorials on building and including precompiled .syso files in packages

2018-12-04 Thread Ian Lance Taylor
On Tue, Dec 4, 2018 at 6:22 AM jclc via golang-nuts wrote: > > I'm very sorry for replying to this old thread, I forgot to post a reply > earlier. > > Unfortunately your reply doesn't really explain much that I didn't already > know. Simply put, I have two questions. > > Firstly, can precompiled

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Iván Corrales Solera
No worries! ahaha It's ok On Tue, Dec 4, 2018 at 3:39 PM Robert Engels wrote: > Sorry, I see it is going from both ends... too early :) > > On Dec 4, 2018, at 8:33 AM, Robert Engels wrote: > > Shouldn’t this code be index = index+ 2 > > for index := 0; index < (len/2)+1; index++ { > outpu

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Robert Engels
Sorry, I see it is going from both ends... too early :) > On Dec 4, 2018, at 8:33 AM, Robert Engels wrote: > > Shouldn’t this code be index = index+ 2 > > for index := 0; index < (len/2)+1; index++ { > output[index], output[len-1-index] = input[len-1-index], input[index] > } > And the loop need

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Robert Engels
Shouldn’t this code be index = index+ 2 for index := 0; index < (len/2)+1; index++ { output[index], output[len-1-index] = input[len-1-index], input[index] } And the loop needs to go to Len - you are only copying half the elements > On Dec 4, 2018, at 5:27 AM, Iván Corrales Solera > wrote: >

Re: [go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-04 Thread Ben Hoyt
Helpful comments and good suggestion, thanks Leonel. -Ben On Tue, Dec 4, 2018 at 9:15 AM Leonel Quinteros wrote: > Hi Ben, > > Sorry, I've misread that part. > Now that I got some sleep and reviewed your code a little bit more, it > looks like you got trapped by your own design decisions. > > Fi

Re: [go-nuts] Documentation/tutorials on building and including precompiled .syso files in packages

2018-12-04 Thread jclc via golang-nuts
I'm very sorry for replying to this old thread, I forgot to post a reply earlier. Unfortunately your reply doesn't really explain much that I didn't already know. Simply put, I have two questions. Firstly, can precompiled .syso files be used to obviate the need for a C-compiler entirely for th

Re: [go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-04 Thread Leonel Quinteros
Hi Ben, Sorry, I've misread that part. Now that I got some sleep and reviewed your code a little bit more, it looks like you got trapped by your own design decisions. First of all, variable shadowing is something every Go developer should be able to handle gracefully, but I understand your concer

[go-nuts] Scaling websockets

2018-12-04 Thread ssskip
As Robert mention, that’s a design problem U should 1. do pub/sub 2. do sharding -- 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...@googlegr

Re: [go-nuts] Generic function aliases

2018-12-04 Thread 'Axel Wagner' via golang-nuts
You can use var Gi = g.G(int) or you can use func Gi(i int) error { return g.G(i) } for the same effect. Which is pretty much the reason why alias-declarations ended up only be added for types - all other declarations can already be emulated sufficiently well. :) On Mon, Dec 3, 2018 at 11:39 PM L

[go-nuts] Re: Best way to handle database transactions? (commit, or rollback on error)

2018-12-04 Thread Manlio Perillo
On Monday, December 3, 2018 at 10:53:30 PM UTC+1, Ben Hoyt wrote: > > Hi folks, > > We found some subtle bugs in our db transaction code for handling > commits/rollbacks. Here's the pattern we were using (not real, but shows > the issue): > > func DoTwoThings() error { > tx, err := db.Begin()

[go-nuts] Best way to handle database transactions? (commit, or rollback on error)

2018-12-04 Thread Tamás Gulácsi
defer tx.Rollback() ... tx.Commit() // at the end -- 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 options, visi

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Iván Corrales Solera
I would also state that Koazee is the only one that doesn't force you to cast data in your filter functions nor sort... because I understand the argument as an interface instead of expect a function with arguments as the other 2 libraries do. On Tuesday, December 4, 2018 at 12:27:14 PM UTC+1, I

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Iván Corrales Solera
Thanks for reply Marko, Sure! I think the approach of making validation smarter and generating code for primitive types was the key. Actually when you ask me for benchmark the first time, the performance was terrible! If we have a look at how operation Filter is implemented: *Filter operat

Re: [go-nuts] Koazee vs Go-Linq vs Go-Funk

2018-12-04 Thread Marko Ristin-Kaufmann
Thanks, Ivan! These numbers are very helpful! Could you at least give us a hint why your library is faster than the other two? As far as I can see, all three libraries in the benchmark use reflection. On Tue, 4 Dec 2018 at 08:49, Iván Corrales Solera < ivan.corrales.sol...@gmail.com> wrote: > Hey