[go-nuts] Re: gomobile - SIGPIPE

2018-02-12 Thread mihai
I managed to get a small reproducible test case. The issue is easy to reproduce. Basically if you spawn some http requests immediately after the application comes back from background you get SIGPIPE. Step by step: 1. Open ios remote.xcodeproj in XCode 2. Run the application on a real device. 3

[go-nuts] Using CGO? Urgent warning, do this or your package may be broken for a long time

2018-02-12 Thread Jason E. Aten
CGO users: In case you weren't already aware: for many Go packages that use CGO, the recently released security-oriented restriction on CGO flags in go1.9.4 /go1.10rc2 broke their build. Reference: https://github.com/golang/go/issues/23672 In order for your specific build flags and options to

Re: [go-nuts] Cross-compiling error for runtime package in go1.9.4 (works in go1.9.2)

2018-02-12 Thread Ian Lance Taylor
On Mon, Feb 12, 2018 at 7:44 PM, Matt R. wrote: > > I have a simple way to reproduce this with GOROOT defined for each golang > version. > > Install gb. https://getgb.io/ > Create a project with the structure: > > src > > app > > main.go (fill with contents of runtime example from documentation >

Re: [go-nuts] Cross-compiling error for runtime package in go1.9.4 (works in go1.9.2)

2018-02-12 Thread Matt R.
I have a simple way to reproduce this with GOROOT defined for each golang version. 1. Install gb. https://getgb.io/ 2. Create a project with the structure: - src - app - main.go (fill with contents of runtime example from documentation https://golang.

[go-nuts] Re: Cross-compiling error for runtime package in go1.9.4 (works in go1.9.2)

2018-02-12 Thread Matt R.
I specifically need CGO disabled to make a statically linked binary, unfortunately. -- 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...@googl

Re: [go-nuts] Pdeathsig alternate for other operating systems

2018-02-12 Thread Ian Lance Taylor
On Mon, Feb 12, 2018 at 5:18 PM, Amandeep Gautam wrote: > > I am writing a process monitoring solution in go for AIX. I would like to > signal the child process when the parent dies so that it does not become > orphaned. In linux, one can set PdeathSig > (https://golang.org/pkg/syscall/#SysProcAtt

Re: [go-nuts] Working with Floating-Point numbers

2018-02-12 Thread Michael Jones
Do you have particular questions? The overall situation is that floating point arithmetic is good, but not like real numbers or symbolic algebra; it is its own world and respecting the details is important (NaNs, representability, tolerance in comparison, etc.) On Mon, Feb 12, 2018 at 10:24 AM, Ia

[go-nuts] Pdeathsig alternate for other operating systems

2018-02-12 Thread Amandeep Gautam
I am writing a process monitoring solution in go for AIX. I would like to signal the child process when the parent dies so that it does not become orphaned. In linux, one can set PdeathSig (https://golang.org/pkg/syscall/#SysProcAttr) and Go will take care of the rest. However this attribute is

Re: [go-nuts] Okay to use mmap ?

2018-02-12 Thread keith . randall
Note though that you can't put pointers to Go heap objects into mmap'd memory, as the garbage collector can't see them. On Monday, February 12, 2018 at 8:37:46 AM UTC-8, Jan Mercl wrote: > > On Mon, Feb 12, 2018 at 5:28 PM Juliusz Chroboczek > wrote: > > > Is it okay to use syscall.Mmap to alloc

Re: [go-nuts] Re: Upcoming Go protobuf release

2018-02-12 Thread johan . brandhorst
I'm hugely in favor of bringing the gogoproto enhancements into golang/protobuf, as a spectator to this discussion. I'm not sure what requirements would put generated binary size over marshalling speed, but maybe I haven't worked on large enough projects yet. We have used gogoproto for about 2

[go-nuts] ANN: "Essential Go" - a free programming book

2018-02-12 Thread Krzysztof Kowalczyk
I'm sharing this hoping it'll be useful for some. I'm working on https://www.programming-books.io/essential/go/, which is a free, open-source, collaborative book about programming in Go. It's based on content generated by Stack Overflow Documentation project. The project was abandoned so I pick

[go-nuts] Re: Safe Packages

2018-02-12 Thread dc0d
And I did not mean this to be a language feature. Just a tool - or part of linter. On Monday, February 12, 2018 at 11:36:36 PM UTC+3:30, dc0d wrote: > > Awesome! > > (IMHO) > > Going for total immutability is not a best fit for Go. I was thinking like > excluding packages like unsafe, reflect,

[go-nuts] Re: Safe Packages

2018-02-12 Thread dc0d
Awesome! (IMHO) Going for total immutability is not a best fit for Go. I was thinking like excluding packages like unsafe, reflect, executing external programs and the like. Capabilities seems unnecessarily complicated - getting used to them is not easy, like in Pony/ponylang. Thanks for th

[go-nuts] Re: Safe Packages

2018-02-12 Thread dc0d
Only in the context of imported packages and only in terms of causing side-effects "outside" the context of current executable binary. On Monday, February 12, 2018 at 11:19:13 PM UTC+3:30, Paul Brousseau wrote: > > I think that might depend on what qualities you define as "safe"? > > > On Monday

[go-nuts] Re: Safe Packages

2018-02-12 Thread matthewjuran
We’ve been discussing stateless packages here: https://github.com/golang/go/issues/23267 Matt On Monday, February 12, 2018 at 1:43:05 PM UTC-6, dc0d wrote: > > Is there a way to identify a package as safe? > > Let's restrict the imported packages to built-in ones. Now assuming a > package only

Re: [go-nuts] Safe Packages

2018-02-12 Thread 'Axel Wagner' via golang-nuts
What does "safe" mean, in this context? In any way, I don't think you can determine that in general. Go allows race conditions and in general they might be abused to do arbitrary unsafe operations, AIUI. If you want safe execution of Go code, use nacl. On Mon, Feb 12, 2018 at 8:43 PM, dc0d wrote

[go-nuts] Re: Safe Packages

2018-02-12 Thread Paul Brousseau
I think that might depend on what qualities you define as "safe"? On Monday, February 12, 2018 at 12:43:05 PM UTC-7, dc0d wrote: > > Is there a way to identify a package as safe? > > Let's restrict the imported packages to built-in ones. Now assuming a > package only imports "strings" and "net/u

[go-nuts] Safe Packages

2018-02-12 Thread dc0d
Is there a way to identify a package as safe? Let's restrict the imported packages to built-in ones. Now assuming a package only imports "strings" and "net/url" can it considered as safe? Since it does not (can not) modify the environment (most notably executing code)? Of course the package st

[go-nuts] Re: choose buffered channel or unbuffered?

2018-02-12 Thread Tamás Gulácsi
Query the DB and LIMIT to an amount which is never reached in a chosen "responseiveness" interval - say 5s. In the "for rows.Next() {}" cycle, check for context.Context.Done() and also a predefined (after query) deadline: ``` rows := db.Query() deadline := time.Now().Add(5*time.Second) for rows.N

Re: [go-nuts] Working with Floating-Point numbers

2018-02-12 Thread Ian Lance Taylor
On Mon, Feb 12, 2018 at 9:40 AM, go-question wrote: > > When working with Floating-point values in Go, what considerations need to > be made? > > The same for any other language? > > The Spec says that "Floating-point values are comparable and ordered" > https://golang.org/ref/spec#Comparison_oper

[go-nuts] choose buffered channel or unbuffered?

2018-02-12 Thread yang sheng
I am trying to design a small app to send emails (stored in MongoDB) using golang utilizing goroutine and channel and this is the first time i use golang. There are 2 types of worker in each server (Retriever and Sender). A single retriever will periodically (every few seconds) query MongoDB

Re: [go-nuts] Working with Floating-Point numbers

2018-02-12 Thread Peter Weinberger
I would say it's the same as most languages. Go implements IEEE floating point, so any comparison with a NaN is false. On Mon, Feb 12, 2018 at 12:40 PM, go-question wrote: > When working with Floating-point values in Go, what considerations need to > be made? > > The same for any other language?

[go-nuts] Working with Floating-Point numbers

2018-02-12 Thread go-question
When working with Floating-point values in Go, what considerations need to be made? The same for any other language? The Spec says that "Floating-point values are comparable and ordered" https://golang.org/ref/spec#Comparison_operators So is comparing by some epsilon value not needed? or only f

Re: [go-nuts] Okay to use mmap ?

2018-02-12 Thread Jan Mercl
On Mon, Feb 12, 2018 at 5:28 PM Juliusz Chroboczek wrote: > Is it okay to use syscall.Mmap to allocate large amounts of memory, or > will it conflict with Go's memory allocator? >From my experience it's ok. Shameless plug: You might want to have a look at a https://github.com/cznic/memory. --

[go-nuts] Okay to use mmap ?

2018-02-12 Thread Juliusz Chroboczek
Hi, Is it okay to use syscall.Mmap to allocate large amounts of memory, or will it conflict with Go's memory allocator? -- Juliusz -- 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,

Re: [go-nuts] Re: Gobot Beaglebone Black GPIO question...

2018-02-12 Thread Silviu Capota Mera
If you have more time to spare on this project, try to circumvent the events / subscriber functionality. Try to see if you can read directly from the adaptor: https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/beaglebone_adaptor.go#L151 so inside your work function, you would d