[go-nuts] Re: How to stream across json-seq RFC-7464

2021-03-28 Thread Greg Saylor
I've tried this suggestion and although its certainly a bit more refactoring then I expected - the outcome looks to be exactly as you described here. Thank you so much for the suggestion, take a bow! - Greg On Sunday, March 28, 2021 at 12:15:34 PM UTC-7 Brian Candler wrote: > No, it's even

[go-nuts] Re: How to stream across json-seq RFC-7464

2021-03-28 Thread Greg Saylor
The inner blob is expecting an io.Reader. But, perhaps I can change that to pass a Decoder based on what you are saying. For some reason I hadn't grokked that is how Decoder was working. Just to re-iterate what I think you are saying (and in case anyone stumbles across this thread later), a

[go-nuts] How to stream across json-seq RFC-7464

2021-03-27 Thread Greg Saylor
Good afternoon, For a case where there's a file containing a sequence of hashes (it could be arrays too, as the underlying object type seems irrelevant) as per RFC-7464. I cannot figure out how to handle this in a memory efficient way that doesn't involve pulling each blob I've tried to expr

Re: [go-nuts] Temporary files in go

2018-10-12 Thread Greg Saylor
If I remember correctly, it would be something like this: fd = open("/tmp", O_TMPFILE | O_RDWR, 0600); linkat(fd, "", AT_FDCWD, "/tmp/test", AT_EMPTY_PATH); This is pretty specific to OS/kernel version and quite possibly the filesystem too. This could be entirely too much of an edge case to be

Re: [go-nuts] Temporary files in go

2018-10-11 Thread Greg Saylor
too much of an edge case to be reasonably done. - Greg > On Oct 11, 2018, at 9:02 PM, Justin Israel wrote: > > > >> On Fri, Oct 12, 2018, 2:31 PM Ian Lance Taylor wrote: >> On Thu, Oct 11, 2018 at 4:48 PM, Greg Saylor >> wrote: >> > >> > In oth

[go-nuts] Temporary files in go

2018-10-11 Thread Greg Saylor
Hello, In other programming languages (this is specific to Linux/Unix systems), in the past to ensure security in the even of a program crash, we would do something like: 1. Create a temporary file and squirrel away the file handle 2. Unlink the temporary file by name 3. Various functions would

Re: [go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Perfect. Thanks so much! - Greg On Tuesday, October 2, 2018 at 12:13:12 PM UTC-7, Burak Serdar wrote: > > https://blog.golang.org/constants > > Foo is an untyped constant. Bar is a string. > On Tue, Oct 2, 2018 at 1:11 PM Greg Saylor > wrote: > > > > Also i

[go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Also it would appear that foo("hello") succeeds to. - Greg On Tuesday, October 2, 2018 at 12:05:04 PM UTC-7, Greg Saylor wrote: > > Hello, > > I'm trying to figure out why foo(Bar) is the only one of these function > calls that fails. It seems like foo(Fo

[go-nuts] Re: string question

2018-10-02 Thread Greg Saylor
Should have mentioned I'm using go version go1.10.2 darwin/amd64 - Greg On Tuesday, October 2, 2018 at 12:05:04 PM UTC-7, Greg Saylor wrote: > > Hello, > > I'm trying to figure out why foo(Bar) is the only one of these function > calls that fails. It seems like foo(Fo

[go-nuts] string question

2018-10-02 Thread Greg Saylor
Hello, I'm trying to figure out why foo(Bar) is the only one of these function calls that fails. It seems like foo(Foo) should to? package main type N string const Foo = "foo" const Bar = string("bar") const Baz = N("baz") func main() { foo(Foo) foo(Bar) foo(Baz) } func foo(n N) { }

[go-nuts] Re: http ssl "can't identify protocol"

2016-09-20 Thread Greg Saylor
Yeah I'm trying to figure out how to get a concise example of this - my deepest apologies. I did try it with default ListenAndServeTLS and it exhibited the same problem. There is no Hijack calls, x/net/ipv4. This is really pretty bare-bones http service. I'd say its about 100 reqs/sec on one

[go-nuts] http ssl "can't identify protocol"

2016-09-20 Thread Greg Saylor
Hello, I've been struggling with someone all day on a very busy server. And I'm at a loss as to what is going on. I have a Go server listening on two ports, like so: tls_config := MustGetTlsConfiguration(*ssl_cert, *ssl_key, *ssl_ca) listener, _ := tls.List