Skip to content

Releases: mautrix/go-util

v0.9.2

16 Oct 09:22

Choose a tag to compare

  • (progver) Added program version calculation utility like the one used by mautrix bridges and Meowlnir.
  • (dbutil) Added sqlite3-fk-wal-fullsync driver which is otherwise equivalent to sqlite3-fk-wal, but sets PRAGMA synchronous=FULL for better crash resistance.
  • (dbutil) Added explicit error if comment prefix (--) isn't at the start of the line when using dialect filters with the (lines commented) modifier.
  • (exsync) Added NewMapWithData, Clear, Len and CopyFrom methods for maps.
  • (exsync) Added iterators for maps and sets.
  • (jsontime) Changed Unix*() methods and jsontime.U*Int() functions to treat 0 and the zero time.Time value as the same.

v0.9.1

16 Sep 11:05

Choose a tag to compare

  • (dbutil) Added general documentation.
  • (random) Added StringCharset for generating a random string with a custom character set and AppendSequence for generating a random slice with a completely arbitrary types.
  • (exslices) Added methods for deduplicating a slice by custom key.
  • (exsync) Added WaitTimeoutCtx for waiting for an Event with both a timeout and a context.

v0.9.0

16 Aug 10:10

Choose a tag to compare

  • Bumped minimum Go version to 1.24.
  • Breaking change (exhttp) Refactored HandleErrors middleware to take raw response data instead of functions returning response data.
  • (requestlog) Added option to recover and log panics.
  • (exhttp) Added syscall.EPIPE to IsNetworkError checks.
  • (exsync) Added Notify method for waking up all Event waiters without setting the flag. This is the atomic equivalent of Set() immediately followed by Clear().
  • (exbytes) Added UnsafeString method for converting a byte slice to a string without copying.
  • (exstrings) Added CollapseSpaces to replace multiple sequential spaces with one.
  • (exstrings) Added PrefixByteRunLength to count the number of occurrences of a given byte at the start of a string.
  • (base58) Fixed panic when input contains non-ASCII characters.

v0.8.8

16 Jun 13:11

Choose a tag to compare

  • (requestlog) Added option to log X-Forwarded-For header value.
  • (exstrings) Added LongestSequenceOfFunc as a customizable version of LongestSequenceOf

v0.8.7

16 May 05:12

Choose a tag to compare

  • (jsonbytes) Added utility for url-safe base64 to complement the existing standard unpadded base64 marshaling utility.
  • (exstrings) Added LongestSequenceOf to find the longest sequence of a single character in a string.
  • (requestlog) Implemented Flush in CountingResponseWriter to fix flushing HTTP response buffer when using request logging.
  • (exhttp) Added utility for checking if a given error is a network error or an http2 stream error.

v0.8.6

16 Mar 14:00

Choose a tag to compare

  • (curl) Added support for parsing cookies set using the -b flag, which recent versions of Chrome use.
  • (exstrings) Added functions for hashing and constant time comparing strings without copying to a byte array.

v0.8.5

16 Feb 15:16

Choose a tag to compare

  • Bumped minimum Go version to 1.23.
  • (dbutil) Deprecated NewRowIter as it encourages bad error handling. NewRowIterWithError and ConvertRowFn[T].NewRowIter are recommended instead, as they support bundling an error inside the iterator.
  • (exslices) Added utility to map and filter a slice in one go.
  • (confusable) Fixed skeleton incorrectly including replacement characters for some input strings.
  • (exbytes) Added utility that implements io.Writer for byte slices without resizing.
  • (glob) Added ToRegexPattern helper which converts a glob to a regex without compiling it.

v0.8.4

16 Jan 09:58

Choose a tag to compare

  • (dbutil) Added option to retry transaction begin calls.
  • (dbutil) Added QueryHelper.QueryManyIter function to get a RowIter instead of pre-reading all rows into a list.
  • (jsontime) Added utilities for durations.

v0.8.3

16 Dec 13:50

Choose a tag to compare

  • (exhttp) Added global flag for disabling automatic CORS headers when using JSON response helper functions.

v0.8.2

16 Nov 14:03

Choose a tag to compare

  • (ffmpeg) Added wrapper functions for ffprobe.
  • (emojirunes) Added method to check if a string is only emojis.
  • (unicodeurls) Updated data sheets used by emojirunes, variationselectors and other packages to Unicode 16.
  • (dbutil) Added support for mass inserts with no static parameters.