Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-12 Thread Sotirios Mantziaris
let's assume you use a package that logs with std "log" package and my app uses something else let's say logrus. What would the logging result be? Would it not be inconsistent? On Monday, February 13, 2017 at 9:47:46 AM UTC+2, Jan Mercl wrote: > > On Mon, Feb 13, 2017 at 8:44 AM Sotirios Mantziar

Re: [go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-12 Thread Jan Mercl
On Mon, Feb 13, 2017 at 8:44 AM Sotirios Mantziaris wrote: > ... which prohibit me of using anything else if i want to have a consistent logging experience. What does "consistent logging experience" mean? -- -j -- You received this message because you are subscribed to the Google Groups "

[go-nuts] [Proposal] Std Lib Logging Abstraction

2017-02-12 Thread Sotirios Mantziaris
Hi, i was wondering if the std lib should implement a logging abstraction so that every lib developer can abstract away logging and let the final lib user provide the implementation it needs. The reason for this is that like everybody else i use a lot of open source and many of them use std "l

Re: [go-nuts] 2016 Go User Survey results

2017-02-12 Thread Matt Joiner
Thanks Dave On 13 February 2017 at 08:30, Dave Cheney wrote: > I raised https://github.com/golang/go/issues/19050 to track this. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit https://gr

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-12 Thread Jakob Borg
You can probably assume by default that any open source project out there with open issues welcomes your help. :) On GitHub, you can list the most starred repos. These are projects that have been around for a long time and probably are fairly mature in welcoming new contributors. Definitely bro

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread Luka Napotnik
Thanks for the answers. I'll play around with C.gettid. Greets, On Mon, Feb 13, 2017 at 7:06 AM, Ian Lance Taylor wrote: On Sun, Feb 12, 2017 at 9:57 PM, Luka Napotnik wrote: Thanks for the reply. I've created a test program with function F1 that calls a C function F2. The function F2 th

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread Ian Lance Taylor
On Sun, Feb 12, 2017 at 9:57 PM, Luka Napotnik wrote: > Thanks for the reply. I've created a test program with function F1 that > calls a C function F2. The function F2 then calls a Go function F3. > > I've started the test once with GOMAXPROCS set to 1, and the second time > without an env. (usin

Re: [go-nuts] The feature I want most, weak *

2017-02-12 Thread Ian Lance Taylor
On Fri, Feb 10, 2017 at 10:04 PM, Keynan Pratt wrote: > Yes it CAN be implemented that way, but that throws away type information, > and makes code less readable. The question of compile-time type information boils down to the generics issue. > It also seems to conflate the difference > between

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread Luka Napotnik
I forgot to mention that the main goroutine in the test program is locked to a thread as I call runtime.LockOSThread() in init() Greets, On Mon, Feb 13, 2017 at 6:57 AM, Luka Napotnik wrote: Thanks for the reply. I've created a test program with function F1 that calls a C function F2. The fun

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread Luka Napotnik
Thanks for the reply. I've created a test program with function F1 that calls a C function F2. The function F2 then calls a Go function F3. I've started the test once with GOMAXPROCS set to 1, and the second time without an env. (using Go 1.7). There are short pauses between calls and I've mea

[go-nuts] Re: Unexpected Behaviour of goroutine

2017-02-12 Thread peterGo
Srivathsan, Go Frequently Asked Questions (FAQ) What happens with closures running as goroutines? https://golang.org/doc/faq#closures_and_goroutines Peter On Sunday, February 12, 2017 at 5:51:14 AM UTC-5, Srivathsan Madhavan wrote: > > Hi all, > > I still consider myself a newbie to Golang hence

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Michael Jones
asking is good! first, it helps people who are too shy or insecure to ask. second, it is part of the adventure of learning. it has often been my experience that the people with the most and best questions end up with the best understanding and spirit. On Sun, Feb 12, 2017 at 9:36 PM, Vatsan wrot

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Vatsan
Thanks to all who answered; I got explanation I needed. @"Michael Jones": yes, your solution also works - "i := i" overshadows the i defined as part of the for-loop and that was also explained in one of the Go-blogs. Anyways, as I have already acknowledged earlier, this was an RTFM moment for me.

Re: [go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread Ian Lance Taylor
On Sun, Feb 12, 2017 at 1:47 AM, wrote: > Hello. I have a Go program that calls C functions in order to create a Gtk+ > GUI. Because Gtk+ itself isn't thread-safe, I'm wondering if it's even > possible to write GUI apps this way since there's no guarantee that the same > thread will be used to ca

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-12 Thread Néstor
Hi, I like e in San Diego, California and I am in the same boat as Malhar, looking for a chance in the Golang world. Jonathan, how do you find out about open source projects in Golang that need help? Thanks, Néstor On Feb 12, 2017 5:35 PM, "Jonathan Yu" wrote: Have you considered contribut

Re: [go-nuts] Looking for free, part-time, remote internship.

2017-02-12 Thread Jonathan Yu
Have you considered contributing to an open source project of interest to you? On Sun, Feb 12, 2017, 10:27 Malhar Vora wrote: > > > > Hi Everyone, > > I am looking for part-time, remote internship kind of opportunity to > work for completely free to learn Golang. Can anyone help me wit

[go-nuts] Re: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-12 Thread Daniel Theophanes
It is difficult to be certain, but I would put my bets on your sql anywhere driver may not be handling the c data lifetimes correctly, or might not be keeping a reference. It is difficult to tell without the driver code. Thanks, -Daniel On Saturday, February 11, 2017 at 7:27:11 PM UTC-8, Mark C

[go-nuts] Re: Panic in go1.8rc3 using cgo to get binary data from database

2017-02-12 Thread Mark Crook
Thanks Damian On Monday, 13 February 2017 04:29:59 UTC+13, Damian Gryski wrote: > > Please file an issue at https://golang.org/issues > > Damian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] 2016 Go User Survey results

2017-02-12 Thread Dave Cheney
I raised https://github.com/golang/go/issues/19050 to track this. -- 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 m

Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread John Feminella
Agreed on the panic, and yours handles that better. (Although I hope it's obvious that this was just a toy example and not the real thing!) best,~ jf--John Feminella@jxxfhttp://jxf.me On Sun, Feb 12, 2017 3:23 PM, Paul Borman bor...@google.com wrote: Your code can panic. Take a look at: htt

Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread 'Paul Borman' via golang-nuts
Your code can panic. Take a look at: https://play.golang.org/p/MrPtar9oEK traverse2 has the type assertion. Notice how the call to traverse2 works but the following call to traverse panics. -Paul On Sun, Feb 12, 2017 at 12:06 PM, John Feminella wrote: > Thanks. I wound up doing this wit

Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread John Feminella
Thanks. I wound up doing this with a recursive traversal: https://play.golang.org/p/k9iy3sHOZ9 best,~ jf--John Feminella@jxxfhttp://jxf.me On Sun, Feb 12, 2017 3:05 PM, Paul Borman bor...@google.com wrote: Take a look at the reflect package, or if you know that the only internal maps will b

Re: [go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread 'Paul Borman' via golang-nuts
Take a look at the reflect package, or if you know that the only internal maps will be of type map[string]interface{} you can use type assertion to determine if the element is a map or some other type. On Sun, Feb 12, 2017 at 7:53 AM, wrote: > I would like to write a function which, given: > >

[go-nuts] A new Golang build tool release

2017-02-12 Thread zhangbodut
Hi list, Recently I have implemented a build tool named Gogradle to provide fully automatic support for Golang. It is a Gradle plugin which supports automatic project-scoped dependency management and many other features: - Perfect cross-platform support, all tests have passed on OS/Windows/Linu

[go-nuts] Writing safe CGO calls and callbacks and how that affects system threads

2017-02-12 Thread luka
Hello. I have a Go program that calls C functions in order to create a Gtk+ GUI. Because Gtk+ itself isn't thread-safe, I'm wondering if it's even possible to write GUI apps this way since there's no guarantee that the same thread will be used to call the API (even if I lock the main goroutine

[go-nuts] Looking for free, part-time, remote internship.

2017-02-12 Thread Malhar Vora
Hi Everyone, I am looking for part-time, remote internship kind of opportunity to work for completely free to learn Golang. Can anyone help me with that ?. Just for your information I already have 3 years of experience in Python and zero experience in Golang. Please

[go-nuts] Re: Struggling with working directory

2017-02-12 Thread Igor Maznitsa
also you can try build golang projects through mvn-golang (with the java maven tool) in the case you should play with environment much less -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fr

[go-nuts] Given a `[]string` key list and a `map[string]interface{}`, can we find the value?

2017-02-12 Thread jxf
I would like to write a function which, given: * a `[]string` keys, and * a `map[string]interface{}` m, will return the value obtained by traversing `m` for each key in `keys`. For example, if `m` looks like: { "foo": 123, "bar": map[string]interface{}{ "one": 111, "t

[go-nuts] Panic in go1.8rc3 using cgo to get binary data from database

2017-02-12 Thread Damian Gryski
Please file an issue at https://golang.org/issues Damian -- 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 optio

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Michael Jones
These answers are all correct. Here is another way to see the problem and address it. Not as clear to the next reader perhaps so not the recommendation, but a good example to contemplate. "Precisely what does this extra statement do?" package main import "fmt" import "log" func main() { for i :

Re: [go-nuts] Go Optimizations for IO Intensive programs

2017-02-12 Thread Jan Mercl
On Sat, Feb 11, 2017 at 1:58 AM wrote: > Are there any other methodologies where I can optimize compresssion part and upload part Many ISPs have upload speed several times slower than download. The symptoms you described would be consistent with that. But maybe you have a better, symmetric conne

Re: [go-nuts] Go Optimizations for IO Intensive programs

2017-02-12 Thread Jesper Louis Andersen
On Sat, Feb 11, 2017 at 1:58 AM wrote: > Are there any other methodologies where I can optimize compresssion part > and upload part > > Start by establishing a baseline. If you just grab the files from S3 and do nothing to to them, how fast is that? If you are not CPU-bound, chances are that you

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Ayan George
Srivathsan Madhavan wrote: > Hi all, > > I still consider myself a newbie to Golang hence my question here could be > due to my fundamental misunderstanding of this language > > I have the following code: > > func main() { > > for i := 0; i < 5; i++ { > > go func() { > >

Re: [go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Jan Mercl
On Sun, Feb 12, 2017 at 11:51 AM Srivathsan Madhavan wrote: A race detector should complain about write to i here for i := 0; i < 5; i++ { concurrently with reading i here log.Println("i=", i) Passing i to the goroutine, instead of sharing it should fix the issue go f

[go-nuts] Unexpected Behaviour of goroutine

2017-02-12 Thread Srivathsan Madhavan
Hi all, I still consider myself a newbie to Golang hence my question here could be due to my fundamental misunderstanding of this language I have the following code: func main() { for i := 0; i < 5; i++ { go func() { log.Println("i=", i) }() } fmt.