Re: [go-nuts] Thread local error information when wrapping lib with cgo

2017-04-05 Thread distributed
Thanks for the clarification. I suppose internal UnlockOSThread does not override the runtime.LockOSThread by my code from the outside? Not really. On error you could malloc a buffer, copy in the string, > and return the buffer to Go. In Go you could copy the buffer into Go > memory and

Re: [go-nuts] XML Stream Parser examples

2017-04-05 Thread Sam Whited
On Wed, Apr 5, 2017 at 6:44 PM, Mandolyte wrote: > I need to parse to find a known element, then based on what I find, decode > its children elements. This implies I need to treat the child elements as a > document (may have to add a fake root node, unless the decoder accepts

[go-nuts] Editor for go-qml

2017-04-05 Thread ravand . city
hello I need to an editor for go-qml , that give me an output like the work that qt creator do. -- 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

[go-nuts] DWARF debugging information ground truth

2017-04-05 Thread kennethadammiller
Hello, I'm doing some research and I would like to know what kind of debugging information any go binary can be compiled with in the DWARF section. In particular, I need to know that the address of each individual instruction can be accounted for in the binary. Is there any way to know

[go-nuts] Recommended design pattern for real-time monitoring and control of an observatory

2017-04-05 Thread James McHugh
I'm writing some software to monitor and control my observatory. It will have many many inputs (clouds, rain, temp, time, roof position, telescope status, focuser status, camera status, filter status etc etc ) and will control the whole setup including opening closing the roof based on weather

Re: [go-nuts] XML Stream Parser examples

2017-04-05 Thread Matt Harden
Here's my favorite way to handle such situations. It can probably be adapted to your situation. https://play.golang.org/p/FQ0g4rytz3 On Wed, Apr 5, 2017 at 4:44 PM Mandolyte wrote: > First, never thought I'd have to parse XML again (it's been over 10 > years), but life

Re: [go-nuts] Re: Last Gasp Call for Native Decimal Support

2017-04-05 Thread Michael Jones
In one of the many threads about this (five years ago!) I mentioned Mike Colinshaw's excellent work: http://speleotrove.com/decimal/ This is an excellent and correct library. I can be inspiration for a native Go implementation. On Wed, Apr 5, 2017 at 4:51 PM, Mandolyte

Re: [go-nuts] Re: Last Gasp Call for Native Decimal Support

2017-04-05 Thread Mandolyte
Doesn't help with operators, but noticed this: https://www.cockroachlabs.com/blog/apd-arbitrary-precision-decimal-package/ On Wednesday, March 29, 2017 at 1:27:22 PM UTC-4, a.mat...@ra-micro.de wrote: > > > No! > > > We want to use operators like + , - , * and / with decimal values. This > is

[go-nuts] XML Stream Parser examples

2017-04-05 Thread Mandolyte
First, never thought I'd have to parse XML again (it's been over 10 years), but life happens... After a lot of searching I found only few examples using the streaming API. But I'm not sure the examples will work for me (I'll find out more tomorrow when I get back to the office). The XML I must

Re: [go-nuts] gomock - why do recorder methods use interface{}?

2017-04-05 Thread Julian Phillips
On 05/04/2017 18:06, Jonathan Yu wrote: Hi everyone, I've been using gomock to generate mock objects (in source mode), and it's been pretty great - way better than maintaining similar code on my own. One thing that I find curious, though, is that expectations are recorded using a generic

[go-nuts] can a program terminate, exit code 2, without an error?

2017-04-05 Thread Dave Cheney
If it's running on Linux the oom killer could be to blame. Ask them customer to check dmesg -- 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

Re: [go-nuts] Golang timers guarantees

2017-04-05 Thread Jesper Louis Andersen
On Wed, Apr 5, 2017 at 2:29 PM wrote: > What guarantees do Golang's timers (e.g. time.After, time.Sleep) provide? > If you're using *lots* of timers concurrently, what (if anything) could > cause them to misbehave (e.g. delay)? What are they bottlenecked by? > > > Most systems

Re: [go-nuts] Syscalls inside loops + runtime.KeepAlive

2017-04-05 Thread Caleb Spare
Thanks, Ian. On Wed, Mar 29, 2017 at 1:03 PM, Ian Lance Taylor wrote: > On Wed, Mar 29, 2017 at 9:42 AM, Caleb Spare wrote: >> I have a question about this runtime.KeepAlive call: >> >>

Re: [go-nuts] Go Path & Github Sync

2017-04-05 Thread Jérôme LAFORGE
>From my experience/point of view, GOPATH is the first concept you have to >understand for managing correctly your project. Even if this concept is finally simple. IMHO, this is the first strange/bad feeling with Go. And lot of my workmates prefer to not start a new project alone (even if the

Re: [go-nuts] Go Path & Github Sync

2017-04-05 Thread Diego Medina
Something that wasn't too clear to me when I started using Go several years ago was "where is the .git folder going to end up as part of the GOPATH path", if this is what you are also wondering, the answer is: go --- bin --- pkg --- src --flmain --flowlogs --github.com

Re: [go-nuts] can a program terminate, exit code 2, without an error?

2017-04-05 Thread 'simon place' via golang-nuts
thanks for the fast response, i couldn't see how this was possible, i'll push them to check. Simon On Wednesday, 5 April 2017 21:46:36 UTC+1, Ian Lance Taylor wrote: > > On Wed, Apr 5, 2017 at 1:35 PM, 'simon place' via golang-nuts > wrote: > > i've been sent an

Re: [go-nuts] can a program terminate, exit code 2, without an error?

2017-04-05 Thread Ian Lance Taylor
On Wed, Apr 5, 2017 at 1:35 PM, 'simon place' via golang-nuts wrote: > i've been sent an bug report saying my program crashed, (they say it > paniced) it includes a running go-routine state dump, but NO error message, > is this really possible or can i assume they

[go-nuts] Re: Golang timers guarantees

2017-04-05 Thread Kevin Powick
This may not be entirely applicable to your use case, but you may find the following Go proposal for Monotonic Time to be an interesting read. https://github.com/golang/proposal/blob/master/design/12914-monotonic.md -- Kevin Powick On Wednesday, 5 April 2017 07:29:40 UTC-5, te...@segment.com

Re: [go-nuts] Go Path & Github Sync

2017-04-05 Thread Justin Israel
On Thu, Apr 6, 2017, 6:55 AM Mukund 8kmiles wrote: > Hi > > Is there a best practice or recommended folder structure followed for > maintaining a GH repo inside GOPATH > > I maintain my GO source in the default GOPATH which is /home//go > > go > --- bin > --- pkg > *--- src*

[go-nuts] Go Path & Github Sync

2017-04-05 Thread Mukund 8kmiles
Hi Is there a best practice or recommended folder structure followed for maintaining a GH repo inside GOPATH I maintain my GO source in the default GOPATH which is /home//go go --- bin --- pkg *--- src* *--flmain* *--flowlogs* *---* I would like to maintain the same path for Github

Re: [go-nuts] Golang timers guarantees

2017-04-05 Thread Ian Lance Taylor
On Wed, Apr 5, 2017 at 10:22 AM, Tejas Manohar wrote: > Thanks! That makes sense. For tickers, would you expect there to be loud > failures (e.g. panics) or silent delays under high load? Seems like silent > delays. I think this is acceptable for Go but am more wondering if I'm

Re: [go-nuts] Golang timers guarantees

2017-04-05 Thread Tejas Manohar
Thanks! That makes sense. For tickers, would you expect there to be loud failures (e.g. panics) or silent delays under high load? Seems like silent delays. I think this is acceptable for Go but am more wondering if I'm missing anything. On Wed, Apr 5, 2017 at 6:26 AM Ian Lance Taylor

Re: [go-nuts] What is time.Nanosecond ?

2017-04-05 Thread Rob Pike
% go doc time.Second const ( Nanosecond Duration = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute ) Common durations. There is no definition

[go-nuts] gomock - why do recorder methods use interface{}?

2017-04-05 Thread Jonathan Yu
Hi everyone, I've been using gomock to generate mock objects (in source mode), and it's been pretty great - way better than maintaining similar code on my own. One thing that I find curious, though, is that expectations are recorded using a generic interface{} type, rather than the original type.

Re: [go-nuts] What is time.Nanosecond ?

2017-04-05 Thread Sebastien Binet
On Wed, Apr 5, 2017 at 5:37 PM, wrote: > Hello, > > I just saw this example: > > time.Sleep(n * time.Second) > > I then looked at http://golang.org/pkg/time, but i couldn't find out what > time.Second is... It is not a function, not a method, not a type... > > What is

[go-nuts] What is time.Nanosecond ?

2017-04-05 Thread mpboom2003
Hello, I just saw this example: time.Sleep(n * time.Second) I then looked at http://golang.org/pkg/time, but i couldn't find out what time.Second is... It is not a function, not a method, not a type... What is this??? Thank you for your time! - Mark -- You received this message because

Re: [go-nuts] Golang timers guarantees

2017-04-05 Thread Ian Lance Taylor
On Wed, Apr 5, 2017 at 12:02 AM, wrote: > What guarantees do Golang's timers (e.g. time.After, time.Sleep) provide? If > you're using lots of timers concurrently, what (if anything) could cause > them to misbehave (e.g. delay)? What are they bottlenecked by? They don't

Re: [go-nuts] Thread local error information when wrapping lib with cgo

2017-04-05 Thread Ian Lance Taylor
On Wed, Apr 5, 2017 at 12:22 AM, distributed wrote: > I am currently wrapping a proprietary library with cgo. > > About error reporting, the library documentation says "Every function that > can fail returns at least boolean or pointer value that can be used to > detect

[go-nuts] Golang timers guarantees

2017-04-05 Thread tejas
What guarantees do Golang's timers (e.g. time.After, time.Sleep) provide? If you're using *lots* of timers concurrently, what (if anything) could cause them to misbehave (e.g. delay)? What are they bottlenecked by? Just curious. Thanks! -- You received this message because you are subscribed

[go-nuts] Error handling best practices and unit testing complex error values

2017-04-05 Thread jlb1990a
Let's say I have an app with three layers: a view (JSON endpoint), service, and persistence layer. Now a `NotFoundError` error occurs at the persistence layer when a record cannot be found. `NotFoundError` is a simple wrapper around a lower level database driver error that I don't want the

[go-nuts] Re: Random Number Genaration - Golang -- Error/Bug

2017-04-05 Thread Mukund 8kmiles
Thanks a lot Uli, , @Uli The go routine safe rand.Int63 resolved the problem. Regards Mukund On Wed, Apr 5, 2017 at 12:51 AM, Uli Kunitz wrote: > Hi Mukund, > > Please recognize that the Source object returned by rand.NewSource is not > safe for concurrent use by

Re: [go-nuts] what's the max length of an identifier

2017-04-05 Thread Jan Mercl
On Wed, Apr 5, 2017 at 12:23 PM wrote: > But i don't find such specification for Golang.Is there any limit on the length of an identifier in Golang? The lack of a specified limit implies no limit other than resources available to the compiler and/or the program. -- -j --

[go-nuts] Re: go program memleak

2017-04-05 Thread Dave Cheney
Can you show an example of your program and how you are capturing the profile. The common mistake is to not close the profile before the program ends. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] what's the max length of an identifier

2017-04-05 Thread Wei . Xiao
For C language, ANSI C recognizes only the first 32 characters in a name. But i don't find such specification for Golang. Is there any limit on the length of an identifier in Golang? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: go program memleak

2017-04-05 Thread cellterry
Hello, Do anyone knows why the profiling seems to be not working as the flat and cum are all 0? BR, Terry On Wednesday, March 22, 2017 at 5:33:48 AM UTC-7, Terry Lai wrote: > > Dear all, > > I had written a go program but I found that it has 100k memory leak per > day. > > I have tried to use

[go-nuts] DebugGC

2017-04-05 Thread Dave Cheney
Try setting GODEBUG=gctrace=1 (untested) -- 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

[go-nuts] DebugGC

2017-04-05 Thread cellterry
Dear all, I found the DebugGC of MemStats got from runtime.ReadMemStats is always false. If I want it to be true, how do I do? BR, Terry -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Thread local error information when wrapping lib with cgo

2017-04-05 Thread distributed
I am currently wrapping a proprietary library with cgo. About error reporting, the library documentation says "Every function that can fail returns at least boolean or pointer value that can be used to detect error state (false and NULL means error, every other value means success). If such