Re: [go-nuts] Is anyone aware of a blocking ring buffer implementation?

2019-11-24 Thread adam.azarchs via golang-nuts
You could always use os.Pipe (which unlike io.Pipe is a standard posix pipe), and wrap one end or the other with bufio.Reader/Writer. Or if all you want to do is buffer the response from http.Get you can just wrap the http response reader with bufio.Reader. Or am I missing something here

[go-nuts] Re: ParseFiles equivalent for strings?

2018-08-05 Thread adam.azarchs via golang-nuts
You can, if you wish, get the best of both worlds by using go generate and a tool like https://github.com/shurcooL/vfsgen to automatically generate go source from those files. On Sunday, August 5, 2018 at 7:33:41 AM UTC-7, buc...@gmail.com wrote: > > After changing from embedding my .html/css

[go-nuts] Re: Gift wrap errors or not?

2018-03-05 Thread adam.azarchs via golang-nuts
Errors in Go aren't really used the same was as exceptions in other languages, and that's a good thing! Most of the time, all you care about is whether the error is non-nil or not. Occasionally you care about the specific type of error, in which case the package emitting the error should

[go-nuts] Re: Build started to fail with 1.10

2018-02-28 Thread adam.azarchs via golang-nuts
I've run into this as well. It looks somewhat related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=314435 As the maintainers explained there, nanosleep isn't part of the c99 standard (it is part of the posix standard). When you set -std=c99, that turns off -D_GNU_SOURCE, which turns

[go-nuts] Getting the current process signal disposition

2017-08-25 Thread adam.azarchs via golang-nuts
TL;DR it would be nice if there were a public API to find the current signal disposition of your process. The runtime already stores that information in runtime.sigtable, but doesn't expose it. I ran into a gotcha with handling SIGHUP the other day. I need to handle SIGHUP in order to shut

[go-nuts] Re: why do we need generic thread.

2017-08-07 Thread adam.azarchs via golang-nuts
Personally I don't think a completely, um, generic version of generics is needed. But something like a list comprehension, possibly specifically limited to "select"/"map" type comprehensions which do not change slice or map length, would be invaluable. There's already a lot of special magic