Releases: benhoyt/goawk
v1.31.0: minor fixes, min Go 1.20
This release includes three minor fixes, and also updates the minimum Go version required (in go.mod) from 1.18 to 1.20. The fixes are:
- Generalise handling of /dev/stderr and /dev/stdout in #268
- Save FS when record is read so we use that value when lazily splitting in #269
- Use WaitDelay to ensure system() exits quickly when context is cancelled in #270
Full Changelog: v1.30.1...v1.31.0
v1.30.1: fix empty action {}
This is a bugfix release that includes a fix for empty actions like {}. See #262
v1.30.0: -N crlf mode, leftmost-longest regexes
This release adds one small new feature and fixes a subtle but long-standing bug:
- The new feature is the
-N modecommand-line option (and correspondinginterp.ConfigfieldNewlineOutput) to control newline translation on output. Currently the default is "smart", meaning no translation (-N raw) on Unix/Linux and translate LF to CR LF (-N crlf) on Windows, but you can override the OS-based default with the-Noption. Thanks @hymkor for the contribution. - The bug fix is that previously GoAWK used the Go default of "leftmost-first matching", whereas other AWKs use "leftmost-longest matching". So switch to that using the
Regexp.Longestmethod.
This release also includes a small performance improvement to the postincr/postdecr bytecode by @triallax in #253.
Full Changelog: v1.29.1...v1.30.0
v1.29.1: Add FreeBSD binaries
This release only exists to add FreeBSD binaries -- no changes since v1.29.0.
v1.29.0: opt-in Unicode chars mode
This release adds Unicode chars mode with goawk -c (or by setting Config.Chars to true when using the Go API). The default is bytes mode as it was before (except that printf %c used chars mode by default as of v1.28.0 -- now it only does if chars mode is enabled). Note that this is the same default as mawk, but the opposite of Gawk (which uses gawk -b to switch to bytes mode).
Chars mode applies to index(), length(), match() (including RSTART and RLENGTH), substr(), and printf's %c verb.
For example, as of version v1.29.0, you can do this:
$ goawk 'BEGIN { print length("a"), length("絵") }'
1 3
$ goawk -c 'BEGIN { print length("a"), length("絵") }'
1 1
Full Changelog: v1.28.1...v1.29.0
v1.28.1
I forgot to bump up the version number for the v1.28.0 release, so this is a patch release with a single commit to do just that.
See also the release notes for the v1.28.0 release.
v1.28.0
NOTE: The original binaries were for the v1.28.0 tag, but had the old v1.27.0 version number in the file names (and in the goawk -version output). I've uploaded corrected v1.28.0 binaries here, but there's also a new v1.28.1 patch release with this fixed.
What's Changed
- Fix evaluation of empty {} and END{} by @benhoyt in #230
- fix: close file in Cover.WriteProfile by @testwill in #232
- Fix number formatting on non-64bit architectures by @guilherme-puida in #235
- Make printf %c work on Unicode codepoints by @oliverkwebb in #236
- Improve error message when missing -H or in BEGIN by @benhoyt in #239
- Add printf %i, %a, %A; Fix %o, %x, %X (they should be unsigned) by @benhoyt in #240
- Make srand() use unix time in seconds, and set seed for next srand() by @benhoyt in #241
- Bump up minimum supported Go version to 1.18, and test on 1.23 by @benhoyt in 7f49055
New Contributors
- @testwill made their first contribution in #232
- @oliverkwebb made their first contribution in #236
Full Changelog: v1.27.0...v1.28.0
v1.27.0: allow redirection to /dev/stderr on Windows, more
What's changed
- Fix wrong precedence of 'expr | getline' expressions by @fioriandrea in #216
- Use C.UTF-8 as locale when invoking external awk program by @guilherme-puida in #226 (first-time contributor)
- New feature: Make redirecting to /dev/stderr work on Windows by @benhoyt in #225
Full Changelog: v1.26.0...v1.27.0
v1.26.0
What's Changed
- Fix rare race in pipe-to-command close() result test by @juster in #213
- Fix #190: FS regex [^,]* fails on empty field by @fioriandrea in #214
- Fix issue #79: Incorrect parsing of complex ++ expressions by @fioriandrea in #215
- Allow optional newline between "do {}" and "while" by @benhoyt in #220
- Distinguish between /regexp/ and "regexp" in stringified output by @ypdn in #222
New Contributors
Full Changelog: v1.25.0...v1.26.0
v1.25.0: PGO, better exit codes, \u escape
This release includes several minor changes:
- Build binaries with PGO on Go 1.21. GoAWK on Go 1.21 is about 10% faster than on Go 1.20, and PGO makes it another 5-6% faster.
- Bumps up the minimum supported Go version from 1.15 to 1.16.
- Makes the return value of
system()andclose()for pipes more closely match Gawk's. Internal refactoring of the input and output stream implementation to make this happen. See issues #203 #204 #205 and thanks @juster! - Support the
\uUnicode string escape that's been added to onetrueawk and Gawk recently. #212