Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-01-12 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2025-01-12 at 19:45 -0600, Jeffery Carr wrote: > > https://go.dev/desidesign/25530-sumdbgn/25530-sumdb. > > > > Ironically, someone did 'go-delete' on that package so the document > is missing ;) This is the correct link: https://go.dev/design/25530-sumdb -- You received this message b

Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-01-12 Thread Jeffery Carr
On Wed, Jan 8, 2025 at 6:51 PM Ian Lance Taylor wrote: Hello! https://go.dev/desidesign/25530-sumdbgn/25530-sumdb. > Ironically, someone did 'go-delete' on that package so the document is missing ;) Yes, a consequence of a secure module proxy is that module names can't > be reused. Fortunately

Re: [go-nuts] Re: Getting new coverage output format from go test -cover

2025-01-12 Thread Paul Chesnais (papacharlie)
The blog post doesn't provide a way to translate the output of `go test -coverprofile ...` (which is the so-called legacy text format) into the new binary format, which `go tool covdata merge` expects. It only provides it in the reverse, i.e. the new binary format to the legacy format. So it me

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread Robert Engels
No worries - happy to help. One last thing base64 coding is fairly trivial - a cursory shows that the padded version uses = signs. I suspect you could write a decoder that handled either during the decoding. > On Jan 12, 2025, at 3:29 PM, Rory Campbell-Lange > wrote: > > Thanks very much fo

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread Rory Campbell-Lange
Thanks very much for the links, pointers and possible solution. Trying to read base64 standard (padded) encoded data with base64.RawStdEncoding can produce an error such as illegal base64 data at input byte Reading base64 raw (unpadded) encoded data produces the EOF error. I'll go with tr

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread robert engels
Also, see this https://stackoverflow.com/questions/69753478/use-base64-stdencoding-or-base64-rawstdencoding-to-decode-base64-string-in-go as I expected the error should be reported earlier than the end of stream if the chosen format is wrong. > On Jan 12, 2025, at 2:57 PM, robert engels wrote:

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread robert engels
Also, this is what Gemini provided which looks basically correct - but I think encapsulating it with a Rewind() method would be easier to understand. While Go doesn't have a built-in PushbackReader like some other languages (e.g., Java), you can implement similar functionality using a custom s

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread Robert Engels
You can see the two pass reader here https://stackoverflow.com/questions/20666594/how-can-i-push-bytes-into-a-reader-in-go But yea, the basic premise is that you buffer the data so you can rewind if needed Are you certain it is reading to the end to return EOF? It may be returning eof once th

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread Rory Campbell-Lange
Thanks for the suggestion of a ReadSeeker to wrap an io.Reader. My google fu must be deserting me. I can find PushbackReader implementations in Java, but the only similar thing for Go I could find was https://gitlab.com/osaki-lab/iowrapper. If you have a specific recommendation for a ReadSeeker

Re: [go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread robert engels
create a ReadSeeker that wraps the Reader providing the buffering (mark & reset) - normally the buffer only needs to be large enough to detect the format contained in the Reader. You can search Google for PushbackReader in Go and you’ll get a basic implementation. > On Jan 12, 2025, at 12:52 P

[go-nuts] Efficiently switch io.Reader to another decoder on error

2025-01-12 Thread Rory Campbell-Lange
I'm looking to develop an alternative to an existing piece of code that reads email parts into byte slices and then returns these after decoding. As library users may not wish to use these email parts and because there a multiple byte slice copies being used, I'm attempting to rationalise the p

[go-nuts] Re: Happy New Year, ctsts = 2025: treeprint + svgo.

2025-01-12 Thread 'bradley klee' via golang-nuts
> Some of my other project ideas are more substantial. Checking the moon calendar here: https://www.timeanddate.com/moon/usa/kansas-city Tomorrow, the Ice Moon rises full in Gemini. After another half cycle it goes dark, and the snake loses its legs, so to speak. In the meantime, here's anoth

[go-nuts] Random Art Algorithm

2025-01-12 Thread Alex Pliutau
Implementing Random Art algorithm in Go. https://youtu.be/TgftD-xrNeo -- 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. T