From 314f33f4ef5b32863bd8e1a9c2d845af6caad557 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 16:37:16 +1000 Subject: [PATCH 01/21] .sis identities --- .sis/project_name.txt | 1 + .sis/script_info_lines.txt | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 .sis/project_name.txt create mode 100644 .sis/script_info_lines.txt diff --git a/.sis/project_name.txt b/.sis/project_name.txt new file mode 100644 index 0000000..3614a7f --- /dev/null +++ b/.sis/project_name.txt @@ -0,0 +1 @@ +recls.Go diff --git a/.sis/script_info_lines.txt b/.sis/script_info_lines.txt new file mode 100644 index 0000000..3e4ab16 --- /dev/null +++ b/.sis/script_info_lines.txt @@ -0,0 +1,3 @@ +recls.Go is a platform-independent recursive file-system search library for Go +Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems +Copyright (c) 2015-2019, Matthew Wilson and Synesis Software From 4c06c989bc5bffb74192410806dd8dc9d1084395 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 17:25:14 +1000 Subject: [PATCH 02/21] CI --- .github/workflows/go.yml | 55 ++++++++++++++++---- build.sh | 108 ++++++++++++++++++++++++++++++++++----- 2 files changed, 140 insertions(+), 23 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 76afd33..6729f3b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,28 +1,65 @@ # This workflow will build a golang project # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go +# +# Created: 18th August 2025 +# Updated: 3rd August 2026 +# + name: Go +env: + VERBOSITY: 1 + on: push: - branches: [ "master" ] + branches: + - boilerplate + - dev + - idiomatic + - master + - rc1 + - rc2 + - rc3 pull_request: - branches: [ "master" ] + +defaults: + run: + shell: bash jobs: build: - runs-on: ubuntu-latest + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + matrix: + go-version: + - '1.23' + - '1.24' + - '1.25' + - '1.26' + os: + - macos-latest + - ubuntu-latest + - windows-latest + + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v4 + - name: "Set up Go ${{ matrix.go-version }}" + uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '${{ matrix.go-version }}' + + - name: "Display Go version" + run: go version - - name: Build + - name: "Build all targets" run: ./build.sh - - name: Test - run: ./run_all_unit_tests.sh + - name: "Run all unit-tests" + run: ./run_all_unit_tests.sh --verbosity ${{ env.VERBOSITY }} diff --git a/build.sh b/build.sh index b6be14a..924db21 100755 --- a/build.sh +++ b/build.sh @@ -2,34 +2,114 @@ ScriptPath=$0 Dir=$(cd $(dirname "$ScriptPath"); pwd) +ProjectNameFile="$Dir/.sis/project_name.txt" +ProjectName=$(tr -d '[:space:]' < "$ProjectNameFile") +# ########################################################## +# command-line handling + +while [[ $# -gt 0 ]]; do + + case $1 in + --help) + + [ -f "$Dir/.sis/script_info_lines.txt" ] && cat "$Dir/.sis/script_info_lines.txt" + cat << EOF +Builds the ${ProjectName} library and (if present) examples + +$ScriptPath [ ... flags/options ... ] + +Flags/options: + + standard flags: + + --help + displays this help and terminates + +EOF + + exit 0 + ;; + *) + + >&2 echo "$ScriptPath: unrecognised argument '$1'; use --help for usage" + + exit 1 + ;; + esac + + shift +done + + +# ########################################################## +# main() + mkdir -p "$Dir/scratch/build-artefacts/" # library -echo "building library ..." -go build -v $Dir +echo "building ${ProjectName} library ..." +go build -v "$Dir" + # examples -if [ -d "$Dir/examples" ];then +if [ -d "$Dir/examples" ]; then - echo "building examples ..." - cd "$Dir/scratch/build-artefacts/" - find "$Dir/examples" -type f -name '*.go' -print -exec go build -v {} \; - cd ->/dev/null + echo "building ${ProjectName} examples ..." + + # subdirectory examples (examples//main.go) + for example_dir in "$Dir"/examples/*/; do + + [ -d "$example_dir" ] || continue + + if [ -f "${example_dir}main.go" ]; then + + example_name=$(basename "$example_dir") + echo "building example ${example_name} ..." + go build -v -o "$Dir/scratch/build-artefacts/${example_name}" "$example_dir" + fi + done + + # loose single-file examples (examples/*.go) + for example_file in "$Dir"/examples/*.go; do + + [ -f "$example_file" ] || continue + + example_name=$(basename "$example_file" .go) + echo "building example ${example_name} ..." + go build -v -o "$Dir/scratch/build-artefacts/${example_name}" "$example_file" + done fi -# tests -if [ -d "$Dir/tests" ];then +# tests (standalone programs under tests/, if present) +if [ -d "$Dir/tests" ]; then + + echo "building ${ProjectName} tests ..." - echo "building tests ..." - cd "$Dir/scratch/build-artefacts/" - find "$Dir/tests" -type f -name '*.go' -print -exec go build -v {} \; - cd ->/dev/null + for test_dir in "$Dir"/tests/*/; do + + [ -d "$test_dir" ] || continue + + if [ -f "${test_dir}main.go" ]; then + + test_name=$(basename "$test_dir") + echo "building test ${test_name} ..." + go build -v -o "$Dir/scratch/build-artefacts/${test_name}" "$test_dir" + fi + done + + for test_file in "$Dir"/tests/*.go; do + + [ -f "$test_file" ] || continue + + test_name=$(basename "$test_file" .go) + echo "building test ${test_name} ..." + go build -v -o "$Dir/scratch/build-artefacts/${test_name}" "$test_file" + done fi # ############################## end of file ############################# # - From 6aa8417522d11240e358720b2d48e358edd8bc26 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 17:30:01 +1000 Subject: [PATCH 03/21] dependencies --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 68ca991..0a58c84 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/synesissoftware/recls.Go -go 1.24.0 +go 1.23.6 require ( github.com/stretchr/testify v1.10.0 From c7a6336b972d417e29162cf5381dac0425994ba9 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 17:30:34 +1000 Subject: [PATCH 04/21] chore: helper scripts --- run_all_unit_tests.sh | 51 +++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/run_all_unit_tests.sh b/run_all_unit_tests.sh index dc27189..3bf9cfb 100755 --- a/run_all_unit_tests.sh +++ b/run_all_unit_tests.sh @@ -2,7 +2,8 @@ ScriptPath=$0 Dir=$(cd $(dirname "$ScriptPath"); pwd) - +ProjectNameFile="$Dir/.sis/project_name.txt" +ProjectName=$(tr -d '[:space:]' < "$ProjectNameFile") ListOnly=0 Verbosity=${XTESTS_VERBOSITY:-${TEST_VERBOSITY:-3}} @@ -25,10 +26,9 @@ while [[ $# -gt 0 ]]; do ;; --help) + [ -f "$Dir/.sis/script_info_lines.txt" ] && cat "$Dir/.sis/script_info_lines.txt" cat << EOF -ANGoLS provides Algorithms Not in the Go Language Standard library -Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems -Runs all (matching) component and unit test programs +Runs all (matching) component and unit test packages $ScriptPath [ ... flags/options ... ] @@ -38,7 +38,7 @@ Flags/options: -l --list-only - lists the target programs but does not execute them + lists the target packages but does not execute them --verbosity specifies an explicit verbosity for the unit-test(s) @@ -68,36 +68,39 @@ done # ########################################################## # main() +cd "$Dir" || exit 1 -for f in $(find $Dir -type f -name '*_test.go') -do +# Only packages that contain tests (avoids broken multi-main examples/ dirs) +Packages=$(go list -f '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{end}}' ./...) - if [ $ListOnly -ne 0 ]; then +if [ -z "$Packages" ]; then - echo "would execute $f:" + echo "${ScriptPath}: no test packages found for ${ProjectName}" - continue - fi + exit 0 +fi - if [ $Verbosity -ge 3 ]; then +if [ $ListOnly -ne 0 ]; then - echo - fi - if [ $Verbosity -ge 2 ]; then + echo "Listing all ${ProjectName} test packages" - echo "executing $f:" - fi + printf '%s\n' $Packages - if [ $Verbosity -ge 2 ]; then + exit 0 +fi - go test -v "$f" - else +if [ $Verbosity -ge 2 ]; then - go test "$f" - fi + echo "Running all ${ProjectName} unit-test packages" +fi -done +if [ $Verbosity -ge 2 ]; then + go test -v $Packages +else -# ############################## end of file ############################# # + go test $Packages +fi + +# ############################## end of file ############################# # From a1a7a365d7652cc16acdb0a5c7dbe0eb8d59fdb4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:18:57 +1000 Subject: [PATCH 05/21] chore: **README.md**: badges and tag line --- AUTHORS.md | 0 CHANGES.md | 2 +- EXAMPLES.md | 2 +- NEWS.md | 0 README.md | 7 ++++--- 5 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 AUTHORS.md create mode 100644 NEWS.md diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..e69de29 diff --git a/CHANGES.md b/CHANGES.md index 11ebe31..3c0ea79 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# **recls.Go** - CHANGES +# recls.Go - CHANGES ## 0.0.0.4 - 18th August 2025 diff --git a/EXAMPLES.md b/EXAMPLES.md index b17f39b..8d86727 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,4 +1,4 @@ -# recls.Go Examples +# recls.Go - Examples | Name | Source & Description | Summary | | ---- | -------------------- | ------- | diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 2d00b76..da5150c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# recls.Go - README +# recls.Go +The platform-independent file-system recursive search library, for Go. + +![Language](https://img.shields.io/badge/Go-00ADD8?style=flat&logo=go&logoColor=white) [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![GitHub release](https://img.shields.io/github/v/release/synesissoftware/recls.Go.svg)](https://github.com/synesissoftware/recls.Go/releases/latest) [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/recls.Go)](https://github.com/synesissoftware/recls.Go/commits/master) @@ -7,8 +10,6 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/recls.Go)](https://goreportcard.com/report/github.com/synesissoftware/recls.Go) [![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/recls.Go.svg)](https://pkg.go.dev/github.com/synesissoftware/recls.Go) -The platform-independent file-system recursive search library, for Go. - ## Table of contents From 434ba1040d94198b5e898c0ac3d33c0401d98ce8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:22:38 +1000 Subject: [PATCH 06/21] chore: boilerplate --- .gitattributes | 6 +----- .gitignore | 5 ++++- .vimrc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 .vimrc diff --git a/.gitattributes b/.gitattributes index 7e0f537..3223702 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,6 @@ -*.c linguist-language=C *.go linguist-language=Go -*.h linguist-language=C -*.cpp linguist-language=C++ -*.hpp linguist-language=C++ *.html linguist-detectable=false *.md linguist-detectable=false *.sh linguist-detectable=false +*.vimrc linguist-detectable=false makefile linguist-detectable=false - diff --git a/.gitignore b/.gitignore index 301e300..bebf8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Synesis Information Systems .gitignore for Go libraries + + # directories (by name) /scratch/ @@ -16,6 +19,7 @@ *~ *.[568vq] *.a +*.dll *.dylib *.exe *.lib @@ -27,4 +31,3 @@ *.test *.tmp *.zip - diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..373dfe4 --- /dev/null +++ b/.vimrc @@ -0,0 +1,54 @@ +" Synesis Go project .vimrc — aligned with .vscode/settings.json (Go) + +set nocompatible +filetype indent plugin on +syntax enable +set autoindent +set backspace=indent,eol,start +set hlsearch +set incsearch +set number + +" files.insertFinalNewline +set eol +set fixeol + +" editor.renderWhitespace: all +set list +set listchars=tab:->,trail:-,extends:>,precedes:<,nbsp:+ + +" editor.detectIndentation: false — global defaults (editor.tabSize: 2, insertSpaces: false) +set colorcolumn=76 +set noexpandtab +set shiftwidth=2 +set softtabstop=2 +set tabstop=2 + +" colorcolumn draws a full-column tint in Vim (not a VS Code-style 1px line). +" Keep it subtle via the ColorColumn highlight group; reapply after colorscheme changes. +if has('termguicolors') + " set termguicolors +endif + +function! s:ConfigureColorColumn() abort + highlight ColorColumn ctermbg=236 guibg=#2a2a2a cterm=NONE gui=NONE +endfunction + +call s:ConfigureColorColumn() +autocmd ColorScheme * call s:ConfigureColorColumn() + +" files.trimTrailingWhitespace +autocmd BufWritePre * %s/\s\+$//e + +augroup sis_go + autocmd! + + " [go] — gofmt uses tabs; match .vscode [go] tabSize 2 / insertSpaces false + autocmd FileType go setlocal noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76,100 + + " [shellscript] + autocmd FileType sh,bash,zsh setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 colorcolumn=60,76 + + " [json] / [markdown] / [yaml] + autocmd FileType json,markdown,yaml setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 +augroup END From b33c0759af383219592509c455f5fa37225f42c4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:28:38 +1000 Subject: [PATCH 07/21] CI --- .github/workflows/go.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6729f3b..a3a3b41 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -36,10 +36,12 @@ jobs: matrix: go-version: - - '1.23' - - '1.24' - - '1.25' - '1.26' + - '1.25' + - '1.24' + - '1.23' + - '1.22' + - '1.21' os: - macos-latest - ubuntu-latest From 5ff2cd945b213a47e03abb3e38ac5dbf4a4d47b7 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:55:56 +1000 Subject: [PATCH 08/21] fix --- version_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/version_test.go b/version_test.go index a9c8e6a..efb115c 100644 --- a/version_test.go +++ b/version_test.go @@ -1,7 +1,7 @@ -package recls +package recls_test import ( - . "github.com/synesissoftware/recls.Go" + recls "github.com/synesissoftware/recls.Go" "github.com/stretchr/testify/require" @@ -16,16 +16,16 @@ const ( ) func Test_Version_Elements(t *testing.T) { - require.Equal(t, Expected_VersionMajor, VersionMajor) - require.Equal(t, Expected_VersionMinor, VersionMinor) - require.Equal(t, Expected_VersionPatch, VersionPatch) - require.Equal(t, Expected_VersionAB, VersionAB) + require.Equal(t, Expected_VersionMajor, recls.VersionMajor) + require.Equal(t, Expected_VersionMinor, recls.VersionMinor) + require.Equal(t, Expected_VersionPatch, recls.VersionPatch) + require.Equal(t, Expected_VersionAB, recls.VersionAB) } func Test_Version(t *testing.T) { - require.Equal(t, uint64(5), Version) + require.Equal(t, uint64(5), recls.Version) } func Test_Version_String(t *testing.T) { - require.Equal(t, "0.0.0", VersionString()) + require.Equal(t, "0.0.0", recls.VersionString()) } From 25d49d52155cf4529cb48e67740df7ce40e3c126 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 19:02:40 +1000 Subject: [PATCH 09/21] chore: standardising .vscode/settings.json --- .vscode/settings.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 864a7cb..58e6d59 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,17 +19,17 @@ "editor.tabSize": 2, "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, - "go.formatFlags": [ - ], - "go.formatTool": "goimports", - "go.lintFlags": [ - "--fast" - ], - "go.lintOnSave": "workspace", - "go.lintTool": "golangci-lint", + "go.formatFlags": [ + ], + "go.formatTool": "goimports", + "go.lintFlags": [ + "--fast", + ], + "go.lintOnSave": "workspace", + "go.lintTool": "golangci-lint", "go.useLanguageServer": true, "gopls": { + "ui.completion.usePlaceholders": true, "ui.semanticTokens": true, - "ui.completion.usePlaceholders": true }, } From 4dbedef2190742b3d8c6590069284d0eb3c16eff Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sun, 9 Aug 2026 17:11:58 +1000 Subject: [PATCH 10/21] squash-commit --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 0a58c84..de137da 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/synesissoftware/recls.Go go 1.23.6 require ( - github.com/stretchr/testify v1.10.0 - github.com/synesissoftware/ver2go v0.1.2 + github.com/stretchr/testify v1.11.1 + github.com/synesissoftware/ver2go v0.1.3 ) require ( diff --git a/go.sum b/go.sum index 0a67060..e411d8a 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/synesissoftware/ver2go v0.1.2 h1:UQu9/nmfdfFyH5lCzycY/yy1pxcnDdwEJnrqhvdvcBI= -github.com/synesissoftware/ver2go v0.1.2/go.mod h1:9gXrNoiRkcKU+QGY3chyozsQKAsKb0A8A89eZuV4lX0= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/synesissoftware/ver2go v0.1.3 h1:5zE+ymD+R0WlgsvtdU0lWYlODXXTiEQuQ6vZj/fO0+o= +github.com/synesissoftware/ver2go v0.1.3/go.mod h1:wpsHnw22T2n4QG6fK1SwBakk+EbMxDt6NLVclU1MvLo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 3d6a8bda57c7ecf0e6294c1342d6908f6d399e81 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:16:47 +1000 Subject: [PATCH 11/21] Reorder README.md so Table of Contents precedes Introduction Aligns with Synesis markdown layout: title, tagline, badges, TOC, then Introduction and body sections --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3c0ea79..e62f5ba 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# recls.Go - CHANGES +# recls.Go - Changes ## 0.0.0.4 - 18th August 2025 From 8caa511d296ea5ca0d81461b6376e113801cab26 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:30:44 +1000 Subject: [PATCH 12/21] Set go.mod minimum to Go 1.21. Aligns all Synesis Go libraries on a common module baseline. Library source is largely Go 1.21-compatible. --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index de137da..24beb59 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/synesissoftware/recls.Go -go 1.23.6 +go 1.21 require ( github.com/stretchr/testify v1.11.1 From b46f5f84545963d87cc5af8511d71c609bfb6fe2 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:38:19 +1000 Subject: [PATCH 13/21] docs: add AUTHORS.md --- AUTHORS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index e69de29..d4df635 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -0,0 +1,22 @@ +# recls.Go - Authors + + +## Major Contributors + +| Name | Email | GitHub | +| ------------ | ------------------------------------ | --------------------------------- | +| Matt Wilson | matthew.wilson.synesis@gmail.com | [mwsis](https://github.com/mwsis) | +| Harry Wilson | harold.wilson.synesis@gmail.com | [Hazzoz](https://github.com/Hazzoz) | + + +## Defect reports, fixes and suggestions (for which we are very grateful) + +| Name | GitHub | +| ------- | ------ | +| \ | | + + +Contributions are welcomed. + + + From ae7e6ac57df287ea95d5154872d03826b81d6736 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:04:49 +1000 Subject: [PATCH 14/21] docs: flesh out NEWS.md --- NEWS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS.md b/NEWS.md index e69de29..c697637 100644 --- a/NEWS.md +++ b/NEWS.md @@ -0,0 +1,11 @@ +# recls.Go - News + + +| Date | News Item | +| ---------------- | --------------------------------------------------------------------------------------------------- | +| 23rd August 2026 | Release of [**recls.Go** 0.0.0.5](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.0.5) | +| 18th August 2025 | Release of [**recls.Go** 0.0.0.4](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.0.4) | +| 13th August 2025 | Release of **recls.Go** 0.0.0.3 | + + + From cef31f253407d94d7827aaf35844da46954a79dd Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:16:26 +1000 Subject: [PATCH 15/21] docs: canonicalise TODO.md --- TODO.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index c4a9455..8c1290d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,20 +1,26 @@ # recls.Go - TODO -recls for Go -## Table of contents +## Table of Contents -- [Section-1](#section-1) -- [Section-2](#section-2) +- [Functional improvements](#functional-improvements) +- [Performance improvements](#performance-improvements) +- [Packaging improvements](#packaging-improvements) -## Section-1 +## Functional improvements -T.B.C. +* \ -## Section-2 +## Performance improvements -T.B.C. +* \ +## Packaging improvements + +* \ + + + From 6dc8919084ed1126ecee8a99f41f88efb7c81ba1 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:24:28 +1000 Subject: [PATCH 16/21] docs: canonicalise EXAMPLES.md and companion example docs --- EXAMPLES.md | 8 ++++---- examples/libver.md | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 examples/libver.md diff --git a/EXAMPLES.md b/EXAMPLES.md index 8d86727..21194ad 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,9 +1,9 @@ # recls.Go - Examples -| Name | Source & Description | Summary | -| ---- | -------------------- | ------- | -| **libver** | [examples/libver.go](./examples/libver.go) | Displays the **recls.Go** library version and terminates | +| Name | Source & Description | Summary | +| ---------- | ---------------------------------------- | -------------------------------------------------------- | +| **libver** | [examples/libver.go](./examples/libver.go)
[examples/libver.md](./examples/libver.md) | Displays the **recls.Go** library version and terminates | - + diff --git a/examples/libver.md b/examples/libver.md new file mode 100644 index 0000000..b6d7159 --- /dev/null +++ b/examples/libver.md @@ -0,0 +1,21 @@ +# recls.Go - Example - **libver** + + +## Summary + +Displays the **recls.Go** library version and terminates. + + +## Source + +See [examples/libver.go](./examples/libver.go). + + +## Execution + +```bash +go run ./examples/libver.go +``` + + + From 23afa2d6ce81d39bab6e5fe73d177b2d775a2975 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:34:00 +1000 Subject: [PATCH 17/21] ci: align Go workflow push branches to Synesis order Use master, dev, then boilerplate, idiomatic, rc1, rc2, rc3 in .github/workflows/go.yml across all Go projects. --- .github/workflows/go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a3a3b41..3eacb25 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,7 +3,7 @@ # # Created: 18th August 2025 -# Updated: 3rd August 2026 +# Updated: 19th August 2026 # name: Go @@ -14,10 +14,10 @@ env: on: push: branches: - - boilerplate + - master - dev + - boilerplate - idiomatic - - master - rc1 - rc2 - rc3 From 4cc9e57820863d25a0c9ce59886ceab7bf52360e Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:43:34 +1000 Subject: [PATCH 18/21] ci: add golangci-lint and tier-aware Go matrix to go.yml Add a lint job (golangci-lint --fast) and identical .golangci.yml across all Go projects; align build-matrix floors to go.mod (1.21 default, 1.23 syngo, 1.24 Diagnosticism.Go). --- .github/workflows/go.yml | 17 +++++++++++++++++ .golangci.yml | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 .golangci.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3eacb25..10ccd34 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -9,6 +9,7 @@ name: Go env: + GO_MIN_VERSION: '1.21' VERBOSITY: 1 on: @@ -65,3 +66,19 @@ jobs: - name: "Run all unit-tests" run: ./run_all_unit_tests.sh --verbosity ${{ env.VERBOSITY }} + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: "Set up Go ${{ env.GO_MIN_VERSION }}" + uses: actions/setup-go@v5 + with: + go-version: '${{ env.GO_MIN_VERSION }}' + + - name: "Run golangci-lint" + uses: golangci/golangci-lint-action@v6 + with: + args: --fast diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..600bef7 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,2 @@ +run: + timeout: 5m From a447f132163f2f547d75428aa655ea75519622de Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:59:31 +1000 Subject: [PATCH 19/21] docs: note pre-release go.mod tidy order in TODO.md Record that go floors, CI matrices, and go mod tidy must wait on newly published Synesis tags, with each project's predecessor list. --- TODO.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 8c1290d..901556f 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,8 @@ ## Packaging improvements -* \ +* [ ] Before the next official release: confirm **`go.mod`** (`go 1.21`) and the CI Go-version matrix, bump Synesis `require`s to newly published tags, then run **`go mod tidy`** (not against currently published tags). Prior Synesis Go releases, in order: + * **ver2go**; From d4dbcdfa916fa421d16eca584619749556ee4174 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 17:31:50 +1000 Subject: [PATCH 20/21] docs: add canonical EOF marker to remaining Go markdown Append the Synesis end-of-file comment to CHANGES.md and README.md files that were missing it. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index da5150c..bb738c6 100644 --- a/README.md +++ b/README.md @@ -83,3 +83,6 @@ Defect reports, feature requests, and pull requests are welcome on https://githu ### License **recls.Go** is released under the 3-clause BSD license. See [LICENSE](./LICENSE) for details. + + + From b76d69b9752350a208068c6780199ef51711b5e6 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 14:14:13 +1000 Subject: [PATCH 21/21] release: prepare recls.Go 0.0.1 (Version API + CI/boilerplate) Replace the Version constant with Version()/CombineVersion, bump ver2go to 0.2.0-beta1, and land CI reliability and README badge cleanup. --- .github/workflows/go.yml | 1 + .golangci.yml | 14 ++++++++++++++ CHANGES.md | 20 +++++++++++++++++++- NEWS.md | 3 ++- README.md | 1 - examples/.golangci.yml | 15 +++++++++++++++ examples/libver.go | 4 ++-- go.mod | 10 +++------- go.sum | 18 ++++++------------ run_all_unit_tests.sh | 16 ++++++++++++++-- version.go | 19 ++++++++++++++++--- version_test.go | 8 ++++---- 12 files changed, 96 insertions(+), 33 deletions(-) create mode 100644 examples/.golangci.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 10ccd34..c34b6d1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -82,3 +82,4 @@ jobs: uses: golangci/golangci-lint-action@v6 with: args: --fast + verify: false diff --git a/.golangci.yml b/.golangci.yml index 600bef7..100b133 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,2 +1,16 @@ +linters: + enable: + - gci + +linters-settings: + gci: + custom-order: true + no-inline-comments: false + no-prefix-comments: false + sections: + - prefix(github.com/synesissoftware/recls.Go) + - default + - standard + run: timeout: 5m diff --git a/CHANGES.md b/CHANGES.md index e62f5ba..21a5bdb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,25 @@ # recls.Go - Changes +## 0.0.1 - 20th August 2026 + +* added **Version()** (replacing the **Version** constant), formed by **ver2go.CombineVersion()**; +* documented **VersionString()**; +* **VersionAB** now uses **ver2go.Release**; +* updated **ver2go** to 0.2.0-beta1; +* updated **examples/libver.go** to use **VersionString()**; +* version string updated for the 0.0.1 release; + + +## 0.0.0.5 - 20th August 2026 + +* CI modernisation (matrix + lint); +* CI reliability fixes (macOS test linking; golangci-lint config verification disabled in CI); +* boilerplate additions (scripts, markdown docs, project identity); +* removed retired Go Report Card badge from README; +* version string updated for the 0.0.0.5 release; + + ## 0.0.0.4 - 18th August 2025 * GitHub Actions; @@ -14,4 +33,3 @@ - diff --git a/NEWS.md b/NEWS.md index c697637..9f090f7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,8 @@ | Date | News Item | | ---------------- | --------------------------------------------------------------------------------------------------- | -| 23rd August 2026 | Release of [**recls.Go** 0.0.0.5](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.0.5) | +| 20th August 2026 | Release of [**recls.Go** 0.0.1](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.1) | +| 20th August 2026 | Release of [**recls.Go** 0.0.0.5](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.0.5) | | 18th August 2025 | Release of [**recls.Go** 0.0.0.4](https://github.com/synesissoftware/recls.Go/releases/tag/0.0.0.4) | | 13th August 2025 | Release of **recls.Go** 0.0.0.3 | diff --git a/README.md b/README.md index bb738c6..4b19766 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ The platform-independent file-system recursive search library, for Go. [![GitHub release](https://img.shields.io/github/v/release/synesissoftware/recls.Go.svg)](https://github.com/synesissoftware/recls.Go/releases/latest) [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/recls.Go)](https://github.com/synesissoftware/recls.Go/commits/master) [![Go](https://github.com/synesissoftware/recls.Go/actions/workflows/go.yml/badge.svg)](https://github.com/synesissoftware/recls.Go/actions/workflows/go.yml) -[![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/recls.Go)](https://goreportcard.com/report/github.com/synesissoftware/recls.Go) [![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/recls.Go.svg)](https://pkg.go.dev/github.com/synesissoftware/recls.Go) diff --git a/examples/.golangci.yml b/examples/.golangci.yml new file mode 100644 index 0000000..20edae5 --- /dev/null +++ b/examples/.golangci.yml @@ -0,0 +1,15 @@ +linters: + enable: + - gci + +linters-settings: + gci: + custom-order: true + no-inline-comments: false + no-prefix-comments: false + sections: + - default + - standard + +run: + timeout: 5m diff --git a/examples/libver.go b/examples/libver.go index f18b73b..4fadb94 100644 --- a/examples/libver.go +++ b/examples/libver.go @@ -8,6 +8,6 @@ import ( ) func main() { - fmt.Printf("recls v%s\n", ver2go.CalcVersionString(recls.VersionMajor, recls.VersionMinor, recls.VersionPatch, recls.VersionAB)) - fmt.Printf("ver2go v%s\n", ver2go.CalcVersionString(ver2go.VersionMajor, ver2go.VersionMinor, ver2go.VersionPatch, ver2go.VersionAB)) + fmt.Printf("recls v%s\n", recls.VersionString()) + fmt.Printf("ver2go v%s\n", ver2go.VersionString()) } diff --git a/go.mod b/go.mod index 24beb59..27fad2a 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,8 @@ module github.com/synesissoftware/recls.Go go 1.21 require ( - github.com/stretchr/testify v1.11.1 - github.com/synesissoftware/ver2go v0.1.3 + github.com/stretchr/testify v1.12.1 + github.com/synesissoftware/ver2go v0.2.0-beta1 ) -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) +require go.yaml.in/yaml/v3 v3.0.5 // indirect diff --git a/go.sum b/go.sum index e411d8a..a1286fc 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,6 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/synesissoftware/ver2go v0.1.3 h1:5zE+ymD+R0WlgsvtdU0lWYlODXXTiEQuQ6vZj/fO0+o= -github.com/synesissoftware/ver2go v0.1.3/go.mod h1:wpsHnw22T2n4QG6fK1SwBakk+EbMxDt6NLVclU1MvLo= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/synesissoftware/ver2go v0.2.0-beta1 h1:9Ne+kvCQMWXA+RhWqqjT+jTP+/9LfKDJyUDSJxxhI5A= +github.com/synesissoftware/ver2go v0.2.0-beta1/go.mod h1:JlZS4ms4D4cCaYuRh+fbBaNv7BwqrAP4m4/hZzGJ8hU= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= diff --git a/run_all_unit_tests.sh b/run_all_unit_tests.sh index 3bf9cfb..b7ec8b5 100755 --- a/run_all_unit_tests.sh +++ b/run_all_unit_tests.sh @@ -94,12 +94,24 @@ if [ $Verbosity -ge 2 ]; then echo "Running all ${ProjectName} unit-test packages" fi +# +# Mitigate rare macOS `dyld` aborts caused by corrupted cached `*.test` binaries. +# +go clean -cache -testcache + +LD_FLAGS="" +if [ "$(uname -s)" = "Darwin" ]; then + # Older Go toolchains can produce Mach-O binaries without LC_UUID on newer macOS + # versions, triggering `dyld: missing LC_UUID load command ...` at test start. + LD_FLAGS="-ldflags=-linkmode=external" +fi + if [ $Verbosity -ge 2 ]; then - go test -v $Packages + go test -v $LD_FLAGS $Packages else - go test $Packages + go test $LD_FLAGS $Packages fi diff --git a/version.go b/version.go index 8517a2c..66bfc1d 100644 --- a/version.go +++ b/version.go @@ -5,15 +5,28 @@ import "github.com/synesissoftware/ver2go" const ( VersionMajor uint16 = 0 VersionMinor uint16 = 0 - VersionPatch uint16 = 0 - VersionAB uint16 = 0x0005 - Version uint64 = (uint64(VersionMajor) << 48) + (uint64(VersionMinor) << 32) + (uint64(VersionPatch) << 16) + (uint64(VersionAB) << 0) + VersionPatch uint16 = 1 + VersionAB uint16 = ver2go.Release ) var ( + version = ver2go.CombineVersion(VersionMajor, VersionMinor, VersionPatch, VersionAB) versionString string = ver2go.CalcVersionString(VersionMajor, VersionMinor, VersionPatch, VersionAB) ) +// Version returns this library's version as a packed 64-bit integer, formed +// by ver2go.CombineVersion from VersionMajor, VersionMinor, VersionPatch, +// and VersionAB. The result is suitable for numeric comparison: a later +// release has a strictly greater value than an earlier one that uses the +// same packing. +func Version() uint64 { + return version +} + +// VersionString returns this library's version as a human-readable string, +// formed by ver2go.CalcVersionString from VersionMajor, VersionMinor, +// VersionPatch, and VersionAB. For a final (non-prerelease) version the +// result is of the form "MAJOR.MINOR.PATCH", e.g. "0.0.1". func VersionString() string { return versionString } diff --git a/version_test.go b/version_test.go index efb115c..736128f 100644 --- a/version_test.go +++ b/version_test.go @@ -11,8 +11,8 @@ import ( const ( Expected_VersionMajor uint16 = 0 Expected_VersionMinor uint16 = 0 - Expected_VersionPatch uint16 = 0 - Expected_VersionAB uint16 = 5 + Expected_VersionPatch uint16 = 1 + Expected_VersionAB uint16 = 0xFFFF ) func Test_Version_Elements(t *testing.T) { @@ -23,9 +23,9 @@ func Test_Version_Elements(t *testing.T) { } func Test_Version(t *testing.T) { - require.Equal(t, uint64(5), recls.Version) + require.Equal(t, uint64(0x0000_0000_0001_FFFF), recls.Version()) } func Test_Version_String(t *testing.T) { - require.Equal(t, "0.0.0", recls.VersionString()) + require.Equal(t, "0.0.1", recls.VersionString()) }