Re: [go-nuts] What is the best way to write MarshalBinary if the data is a sequence of ints

2022-10-23 Thread Amnon
What is best depends on what you want to achieve. Do you want the most compact encoding? Or the fastest encoding? Or the encoding which is easiest to debug? Or the simplest encoding? Or an encoding which allows you to gracefully add fields to the type as your program evolves without invalidating

Re: [go-nuts] Error Handling Question

2022-10-23 Thread 'Daniel Lepage' via golang-nuts
On Sun, Oct 23, 2022 at 1:08 AM Brian Candler wrote: > > And I agree that the above function is much easier to read and much > faster to write than the first version! But now I'm raising unchecked > exceptions instead of handling errors properly. > > However you're not "raising an unchecked excep

[go-nuts] MPEG-1 Video decoder, MP2 Audio decoder and MPEG-PS Demuxer in pure Go

2022-10-23 Thread Milan Nikolic
A simple way to get video playback into your app or game. https://github.com/gen2brain/mpeg There is also a live web example here https://gen2brain.github.io/mpeg. The CPU usage is higher than on the desktop but it is still usable. Interestingly, while TinyGo produced 4x smaller binary, the pe

[go-nuts] SFTPGo 2.4.0 Released

2022-10-23 Thread Nicola Murino
Hi all, I'm pleased to announce SFTPGo 2.4.0! SFTPGo is a fully featured and highly configurable SFTP, FTP/S, HTTP/S and WebDAV server that supports several storage backends: local filesystem, S3 (compatible) Object Storage, Google Cloud Storage, Azure Blob Storage, other SFTP servers. The ma

Re: [go-nuts] Error Handling Question

2022-10-23 Thread Volker Dobler
On Saturday, 22 October 2022 at 22:25:16 UTC+2 dple...@google.com wrote: > that the above function is much easier to read and much faster to write True but in my opinion not relevant because: 1. Time to write a function is almost negligible compare to its time needed for maintenance, rewrites, u

Re: [go-nuts] What is the best way to write MarshalBinary if the data is a sequence of ints

2022-10-23 Thread Martin Schnabel
hi travis, if you can use any encoding you like, you can write your own custom encoding that uses a varint encoding. the binary encoding interface implies that the framing or length segmenting of the raw bytes happens outside that function, so you can just read and write all your ints using the v