From 515c3ac1a480d8e8db6f206cbb267e932a0f63c1 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sun, 2 Aug 2026 16:25:48 +1000 Subject: [PATCH 01/43] chore: markdown consistency changes --- CHANGES.md | 2 +- EXAMPLES.md | 2 +- TODO.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5fca028..3ec9c64 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# **Diagnosticism.Go** Changes +# Diagnosticism.Go - CHANGES ## 0.13.4 - 29th March 2026 diff --git a/EXAMPLES.md b/EXAMPLES.md index d5aa722..aa139b2 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Examples +# Diagnosticism.Go - Examples |Name|Source & Description|Summary| |---|---|---| diff --git a/TODO.md b/TODO.md index edbc5a8..659b0cc 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ -# TODO +# Diagnosticism.Go - TODO \ From feb2d941de43bf8409fd5f94ec026447ec88f0bc Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sun, 2 Aug 2026 16:34:02 +1000 Subject: [PATCH 02/43] chore: LICENSE update --- LICENSE | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index a48979e..33a359e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,6 @@ -BSD 3-Clause License - Diagnosticism.Go - -Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems +Diagnosticism.Go - BSD 3-Clause License +Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems All rights reserved. Redistribution and use in source and binary forms, with or without From 9ffd5eb5f5c572c50ecf0edbb287502095edbccc Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sun, 2 Aug 2026 16:52:49 +1000 Subject: [PATCH 03/43] .gitattributes --- .gitattributes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 7e0f537..ea88959 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,11 @@ *.c linguist-language=C +*.cpp 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 makefile linguist-detectable=false +*.vimrc linguist-detectable=false From e8ca414d4d05f2d69663e14372907775ff1d226a Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Sun, 2 Aug 2026 16:53:26 +1000 Subject: [PATCH 04/43] .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 301e300..d8fa976 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ *~ *.[568vq] *.a +*.dll *.dylib *.exe *.lib From 165e7dbd13655d3d6a812247fddbc5214c752d00 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 16:37:16 +1000 Subject: [PATCH 05/43] .sis identities --- .sis/project_name.txt | 1 + .sis/script_info_lines.txt | 2 ++ 2 files changed, 3 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..ec272a6 --- /dev/null +++ b/.sis/project_name.txt @@ -0,0 +1 @@ +Diagnosticism.Go diff --git a/.sis/script_info_lines.txt b/.sis/script_info_lines.txt new file mode 100644 index 0000000..18faec1 --- /dev/null +++ b/.sis/script_info_lines.txt @@ -0,0 +1,2 @@ +Diagnosticism.Go provides basic diagnostic facilities for Go +Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems From 5e09957aa132b893178e05d1a0c13dc381f042a4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 17:25:14 +1000 Subject: [PATCH 06/43] CI --- .github/workflows/go.yml | 33 +++++++----- build.sh | 108 ++++++++++++++++++++++++++++++++++----- 2 files changed, 115 insertions(+), 26 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5efeb59..6729f3b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,7 +3,7 @@ # # Created: 18th August 2025 -# Updated: 18th March 2026 +# Updated: 3rd August 2026 # name: Go @@ -13,9 +13,19 @@ env: on: push: - branches: [ "master", "dev", "gha" ] + branches: + - boilerplate + - dev + - idiomatic + - master + - rc1 + - rc2 + - rc3 pull_request: - branches: [ "master", "dev", "gha" ] + +defaults: + run: + shell: bash jobs: @@ -26,25 +36,24 @@ jobs: matrix: go-version: - - '1.25' - - '1.24' - '1.23' - - '1.22' - - '1.21' + - '1.24' + - '1.25' + - '1.26' os: - macos-latest - ubuntu-latest - windows-latest - runs-on: ${{matrix.os}} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - name: "Set up Go ${{matrix.go-version}}" - uses: actions/setup-go@v4 + - name: "Set up Go ${{ matrix.go-version }}" + uses: actions/setup-go@v5 with: - go-version: '${{matrix.go-version}}' + go-version: '${{ matrix.go-version }}' - name: "Display Go version" run: go version @@ -53,4 +62,4 @@ jobs: run: ./build.sh - name: "Run all unit-tests" - run: ./run_all_unit_tests.sh --verbosity ${{env.VERBOSITY}} + run: ./run_all_unit_tests.sh --verbosity ${{ env.VERBOSITY }} diff --git a/build.sh b/build.sh index bc8e856..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 76c8cfd7fdc4116f1a2561c9937a774349f909a4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 17:30:34 +1000 Subject: [PATCH 07/43] 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 cf87174..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 de04eb5c6251754527be3e77f42b17cbef79fae0 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:18:57 +1000 Subject: [PATCH 08/43] chore: **README.md**: badges and tag line --- AUTHORS.md | 0 NEWS.md | 0 README.md | 6 +++--- 3 files changed, 3 insertions(+), 3 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/NEWS.md b/NEWS.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 0563d20..e828bb4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Diagnosticism.Go +Basic diagnostic facilities, 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/Diagnosticism.Go.svg)](https://github.com/synesissoftware/Diagnosticism.Go/releases/latest) [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/Diagnosticism.Go)](https://github.com/synesissoftware/Diagnosticism.Go/commits/master) @@ -7,8 +10,6 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/Diagnosticism.Go)](https://goreportcard.com/report/github.com/synesissoftware/Diagnosticism.Go) [![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/Diagnosticism.Go.svg)](https://pkg.go.dev/github.com/synesissoftware/Diagnosticism.Go) -Basic diagnostic facilities, for Go - ## Table of Contents @@ -322,4 +323,3 @@ Defect reports, feature requests, and pull requests are welcome on https://githu - From a720e3e5de789c68e68bf168a0d1a0212c3331eb Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:22:38 +1000 Subject: [PATCH 09/43] chore: boilerplate --- .gitattributes | 7 +------ .gitignore | 4 +++- .vimrc | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 .vimrc diff --git a/.gitattributes b/.gitattributes index ea88959..3223702 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,6 @@ -*.c linguist-language=C -*.cpp linguist-language=C++ *.go linguist-language=Go -*.h linguist-language=C -*.hpp linguist-language=C++ *.html linguist-detectable=false *.md linguist-detectable=false *.sh linguist-detectable=false -makefile linguist-detectable=false *.vimrc linguist-detectable=false - +makefile linguist-detectable=false diff --git a/.gitignore b/.gitignore index d8fa976..bebf8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Synesis Information Systems .gitignore for Go libraries + + # directories (by name) /scratch/ @@ -28,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 0d84c95412e37a8514705fa923c50abb1f7c8dba Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:28:38 +1000 Subject: [PATCH 10/43] 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 ac9b49bd2759af92731f4e99db3a17e6cf7443c4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 18:55:00 +1000 Subject: [PATCH 11/43] fix --- debug_test.go | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/debug_test.go b/debug_test.go index e6c6af0..399677a 100644 --- a/debug_test.go +++ b/debug_test.go @@ -7,11 +7,15 @@ import ( "testing" ) -func Test_File(t *testing.T) { +// Optional Windows drive letter prefix (e.g. "D:"), then path segments that may +// not contain ':' until the first deliberate separator used by FileLine*. +const ( + reWinDrive = `(?:[A-Za-z]:)?` +) - // NOTE: this regex will likely not work on Windows +func Test_File(t *testing.T) { - expected := `^[^:]+debug_test[^:]+$` + expected := `^` + reWinDrive + `[^:]*debug_test[^:]*$` actual := d.File() match, _ := regexp.MatchString(expected, actual) @@ -23,9 +27,7 @@ func Test_File(t *testing.T) { func Test_FileLine(t *testing.T) { - // NOTE: this regex will likely not work on Windows - - expected := `^[^:]+debug_test[^:]+:\d+$` + expected := `^` + reWinDrive + `[^:]*debug_test[^:]*:\d+$` actual := d.FileLine() match, _ := regexp.MatchString(expected, actual) @@ -37,8 +39,6 @@ func Test_FileLine(t *testing.T) { func Test_Function(t *testing.T) { - // NOTE: this regex will likely not work on Windows - expected := `^.*Test_Function$` actual := d.Function() @@ -51,9 +51,7 @@ func Test_Function(t *testing.T) { func Test_FileLineFunction(t *testing.T) { - // NOTE: this regex will likely not work on Windows - - expected := `^[^:]+debug_test[^:]+:\d+:.*Test_FileLineFunction$` + expected := `^` + reWinDrive + `[^:]*debug_test[^:]*:\d+:.*Test_FileLineFunction$` actual := d.FileLineFunction() match, _ := regexp.MatchString(expected, actual) @@ -65,9 +63,7 @@ func Test_FileLineFunction(t *testing.T) { func Test_Line(t *testing.T) { - // NOTE: this regex will likely not work on Windows - - expected := 71 + expected := 67 actual := d.Line() if expected != actual { @@ -78,8 +74,6 @@ func Test_Line(t *testing.T) { func Test_LineFunction(t *testing.T) { - // NOTE: this regex will likely not work on Windows - expected := `^\d+:.*Test_LineFunction$` actual := d.LineFunction() @@ -92,9 +86,7 @@ func Test_LineFunction(t *testing.T) { func Test_GetFileLineFor(t *testing.T) { - // NOTE: this regex will likely not work on Windows - - expected := `^[^:]+debug_test[^:]+:\d+$` + expected := `^` + reWinDrive + `[^:]*debug_test[^:]*:\d+$` actual, _ := d.GetFileLineFor(0) match, _ := regexp.MatchString(expected, actual) @@ -106,7 +98,7 @@ func Test_GetFileLineFor(t *testing.T) { func Test_GetFileLineFunctionFor(t *testing.T) { - expected := `^[^:]+debug_test[^:]+:\d+:.*Test_GetFileLineFunctionFor$` + expected := `^` + reWinDrive + `[^:]*debug_test[^:]*:\d+:.*Test_GetFileLineFunctionFor$` actual, _ := d.GetFileLineFunctionFor(0) match, _ := regexp.MatchString(expected, actual) From 8f498110bbc9548a05a6a018b6bb92bc50e56f17 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Mon, 3 Aug 2026 19:02:39 +1000 Subject: [PATCH 12/43] chore: standardising .vscode/settings.json --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index eeeb2c0..c3c593e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,13 +27,13 @@ ], "go.formatTool": "goimports", "go.lintFlags": [ - "--fast" + "--fast", ], "go.lintOnSave": "workspace", "go.lintTool": "golangci-lint", "go.useLanguageServer": true, "gopls": { + "ui.completion.usePlaceholders": true, "ui.semanticTokens": true, - "ui.completion.usePlaceholders": true }, } From 1b2f803f53f4630867db5ef685af0f9ec08502c2 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:16:30 +1000 Subject: [PATCH 13/43] 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 +- examples/conrep.md | 2 +- examples/conrep_with_log_mirroring.md | 2 +- examples/debugging.md | 2 +- examples/doomgram.md | 2 +- examples/log_with_custom_backend.md | 2 +- examples/logf_fail.md | 2 +- examples/tracing.md | 2 +- examples/version.md | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3ec9c64..3b6f2d5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go - CHANGES +# Diagnosticism.Go - Changes ## 0.13.4 - 29th March 2026 diff --git a/examples/conrep.md b/examples/conrep.md index 8719ac7..81bd190 100644 --- a/examples/conrep.md +++ b/examples/conrep.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **conrep** +# Diagnosticism.Go - Example - **conrep** ## Summary diff --git a/examples/conrep_with_log_mirroring.md b/examples/conrep_with_log_mirroring.md index 91d09c6..96706b8 100644 --- a/examples/conrep_with_log_mirroring.md +++ b/examples/conrep_with_log_mirroring.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **conrep_with_log_mirroring** +# Diagnosticism.Go - Example - **conrep_with_log_mirroring** ## Summary diff --git a/examples/debugging.md b/examples/debugging.md index 4606b0d..fdea1f6 100644 --- a/examples/debugging.md +++ b/examples/debugging.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **debugging** +# Diagnosticism.Go - Example - **debugging** ## Summary diff --git a/examples/doomgram.md b/examples/doomgram.md index 9895c49..827cb48 100644 --- a/examples/doomgram.md +++ b/examples/doomgram.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **doomgram** +# Diagnosticism.Go - Example - **doomgram** ## Summary diff --git a/examples/log_with_custom_backend.md b/examples/log_with_custom_backend.md index 1210c8a..a01c93c 100644 --- a/examples/log_with_custom_backend.md +++ b/examples/log_with_custom_backend.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **conrep_with_custom_backend** +# Diagnosticism.Go - Example - **conrep_with_custom_backend** ## Summary diff --git a/examples/logf_fail.md b/examples/logf_fail.md index 9547a1d..6871b5f 100644 --- a/examples/logf_fail.md +++ b/examples/logf_fail.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **flog_fail** +# Diagnosticism.Go - Example - **flog_fail** ## Summary diff --git a/examples/tracing.md b/examples/tracing.md index 3d5a56d..24083d8 100644 --- a/examples/tracing.md +++ b/examples/tracing.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **tracing** +# Diagnosticism.Go - Example - **tracing** ## Summary diff --git a/examples/version.md b/examples/version.md index f18e501..bc7be83 100644 --- a/examples/version.md +++ b/examples/version.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go Example - **tracing** +# Diagnosticism.Go - Example - **tracing** ## Summary From ca33e4bcdce9303c8dd03932346bc8cddb2e7085 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:31:37 +1000 Subject: [PATCH 14/43] 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; follow-up work remains for Diagnosticism x/term, p99/syngo examples, and republishing the STEGoL/ver2go dependency chain. --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 041dd3e..49b2126 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,17 @@ module github.com/synesissoftware/Diagnosticism.Go -go 1.23.6 +go 1.21 require ( github.com/stretchr/testify v1.11.1 github.com/synesissoftware/STEGoL v0.3.0 github.com/synesissoftware/ver2go v0.1.3 - golang.org/x/term v0.34.0 + golang.org/x/term v0.40.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.35.0 // indirect + golang.org/x/sys v0.41.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 74a9064..a393bf1 100644 --- a/go.sum +++ b/go.sum @@ -8,10 +8,10 @@ github.com/synesissoftware/STEGoL v0.3.0 h1:3Q1x7S472seaMlxBD1WR+Ax5qxDSFBb7jZ/E github.com/synesissoftware/STEGoL v0.3.0/go.mod h1:TWWL9GPgKTuO2u3xGhCqYp7nvQbkxKq2vnjUJ2O8gSQ= 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= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4= -golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= +golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= 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 3653b9272fe5d683427bae5ad326dccf0b66fe21 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:34:15 +1000 Subject: [PATCH 15/43] fix: go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 49b2126..7d1adc5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/synesissoftware/Diagnosticism.Go -go 1.21 +go 1.24.0 require ( github.com/stretchr/testify v1.11.1 From 0e744d50e92199b2388d8f75c9c16381e622bd21 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 15:38:19 +1000 Subject: [PATCH 16/43] docs: add AUTHORS.md --- AUTHORS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index e69de29..1f97604 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -0,0 +1,22 @@ +# Diagnosticism.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 f385bf192ec2ddad12c6af3cf42a0ff28204eb21 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:04:49 +1000 Subject: [PATCH 17/43] docs: flesh out NEWS.md --- NEWS.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/NEWS.md b/NEWS.md index e69de29..16c690b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -0,0 +1,41 @@ +# Diagnosticism.Go - News + + +| Date | News Item | +| ------------------- | ----------------------------------------------------------------------------------------------------------------- | +| 23rd August 2026 | Release of [**Diagnosticism.Go** 0.13.5](https://github.com/synesissoftware/Diagnosticism.Go/releases/tag/0.13.5) | +| 29th March 2026 | Release of [**Diagnosticism.Go** 0.13.4](https://github.com/synesissoftware/Diagnosticism.Go/releases/tag/0.13.4) | +| 18th March 2026 | Release of **Diagnosticism.Go** 0.13.3 | +| 18th March 2026 | Release of **Diagnosticism.Go** 0.13.2 | +| 18th March 2026 | Release of **Diagnosticism.Go** 0.13.1 | +| 1st March 2026 | Release of **Diagnosticism.Go** 0.13.0 | +| 1st March 2026 | Release of **Diagnosticism.Go** 0.12.1 | +| 20th December 2025 | Release of **Diagnosticism.Go** 0.12.0 | +| 20th December 2025 | Release of **Diagnosticism.Go** 0.12.0-alpha2 | +| 11th October 2025 | Release of **Diagnosticism.Go** 0.12.0-alpha1 | +| 28th September 2025 | Release of **Diagnosticism.Go** 0.11.0 | +| 3rd September 2025 | Release of **Diagnosticism.Go** 0.10.0 | +| 27th August 2025 | Release of **Diagnosticism.Go** 0.10.0-beta1 | +| 27th August 2025 | Release of **Diagnosticism.Go** 0.9.1-beta4 | +| 26th August 2025 | Release of **Diagnosticism.Go** 0.9.1-beta3 | +| 18th August 2025 | Release of **Diagnosticism.Go** 0.9.1-beta2 | +| 18th August 2025 | Release of **Diagnosticism.Go** 0.9.1-beta1 | +| 15th August 2025 | Release of **Diagnosticism.Go** 0.9.0 | +| 27th March 2025 | Release of **Diagnosticism.Go** 0.8.0 | +| 26th March 2025 | Release of **Diagnosticism.Go** 0.8.0-alpha1 | +| 25th March 2025 | Release of **Diagnosticism.Go** 0.7.0 | +| 22nd February 2025 | Release of **Diagnosticism.Go** 0.7.0-alpha1 | +| 22nd February 2025 | Release of **Diagnosticism.Go** 0.6.1 | +| 23rd July 2020 | Release of **Diagnosticism.Go** 0.6.0 | +| 22nd July 2020 | Release of **Diagnosticism.Go** 0.5.0.1 | +| 20th July 2020 | Release of **Diagnosticism.Go** 0.5.0 | +| 8th July 2019 | Release of **Diagnosticism.Go** 0.4.0 | +| 8th July 2019 | Release of **Diagnosticism.Go** 0.4.0 | +| 4th June 2019 | Release of **Diagnosticism.Go** 0.3.2 | +| 1st June 2019 | Release of **Diagnosticism.Go** 0.3.1 | +| 1st June 2019 | Release of **Diagnosticism.Go** 0.3.0 | +| 30th May 2019 | Release of **Diagnosticism.Go** 0.2.0 | +| 28th March 2019 | Release of **Diagnosticism.Go** 0.1.0 | + + + From 0233fab94ac3162df89c1f89663d8c8c8971b62d Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:16:26 +1000 Subject: [PATCH 18/43] docs: canonicalise TODO.md --- TODO.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 659b0cc..2bcc249 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,26 @@ # Diagnosticism.Go - TODO -\ +## Table of Contents - +- [Functional improvements](#functional-improvements) +- [Performance improvements](#performance-improvements) +- [Packaging improvements](#packaging-improvements) + + +## Functional improvements + +* \ + + +## Performance improvements +* \ + +## Packaging improvements + +* \ + + + From d7afe324bb72867d17b55b689dc0559f3d817c57 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:24:28 +1000 Subject: [PATCH 19/43] docs: canonicalise EXAMPLES.md and companion example docs --- EXAMPLES.md | 21 ++++++++++++--------- examples/libver.md | 21 +++++++++++++++++++++ examples/log_with_custom_backend.md | 2 +- examples/logf_fail.md | 2 +- examples/version.md | 2 +- 5 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 examples/libver.md diff --git a/EXAMPLES.md b/EXAMPLES.md index aa139b2..f5be56f 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -1,14 +1,17 @@ # Diagnosticism.Go - Examples -|Name|Source & Description|Summary| -|---|---|---| -|**conrep**|[examples/conrep/main.go](/examples/conrep/main.go)
[examples/conrep.md](/examples/conrep.md)|Example illustrating use of **Contingent Report API**| -|**conrep_with_log_mirroring**|[examples/conrep_with_log_mirroring/main.go](/examples/conrep_with_log_mirroring/main.go)
[examples/conrep_with_log_mirroring.md](/examples/conrep_with_log_mirroring.md)|Example illustrating use of **Contingent Report API** with log mirroring| -|**debugging**|[examples/debugging/main.go](/examples/debugging/main.go)
[examples/debugging.md](/examples/debugging.md)|Example illustrating use of **Debugging API**.| -|**doomgram**|[examples/doomgram/main.go](/examples/doomgram/main.go)
[examples/doomgram.md](/examples/doomgram.md)|Example illustrating use of `DOOMGram` structure and its timing strips| -|**logf_fail**|[examples/logf_fail/main.go](/examples/logf_fail/main.go)
[examples/logf_fail.md](/examples/logf_fail.md)|Example illustrating use of **Log API** with ``Logf()`` errors (in arguments)| -|**tracing**|[examples/tracing/main.go](/examples/tracing/main.go)
[examples/tracing.md](/examples/tracing.md)|Example illustrating use of **Trace API**| +| Name | Source & Description | Summary | +| ----------------------------- | ---------------------------------------- | --------------------------------------------------------------------------- | +| **conrep** | [examples/conrep/main.go](./examples/conrep/main.go)
[examples/conrep.md](./examples/conrep.md) | Example illustrating use of **Contingent Report API** | +| **conrep_with_log_mirroring** | [examples/conrep_with_log_mirroring/main.go](./examples/conrep_with_log_mirroring/main.go)
[examples/conrep_with_log_mirroring.md](./examples/conrep_with_log_mirroring.md) | Example illustrating use of **Contingent Report API** with log mirroring | +| **debugging** | [examples/debugging/main.go](./examples/debugging/main.go)
[examples/debugging.md](./examples/debugging.md) | Example illustrating use of **Debugging API** | +| **doomgram** | [examples/doomgram/main.go](./examples/doomgram/main.go)
[examples/doomgram.md](./examples/doomgram.md) | Example illustrating use of `DOOMGram` structure and its timing strips | +| **libver** | [examples/libver/main.go](./examples/libver/main.go)
[examples/libver.md](./examples/libver.md) | Displays the **Diagnosticism.Go** library version and terminates | +| **log_with_custom_backend** | [examples/log_with_custom_backend/main.go](./examples/log_with_custom_backend/main.go)
[examples/log_with_custom_backend.md](./examples/log_with_custom_backend.md) | Example illustrating use of **Log API** with a custom back-end | +| **logf_fail** | [examples/logf_fail/main.go](./examples/logf_fail/main.go)
[examples/logf_fail.md](./examples/logf_fail.md) | Example illustrating use of **Log API** with `Logf()` errors (in arguments) | +| **tracing** | [examples/tracing/main.go](./examples/tracing/main.go)
[examples/tracing.md](./examples/tracing.md) | Example illustrating use of **Trace API** | +| **version** | [examples/version/main.go](./examples/version/main.go)
[examples/version.md](./examples/version.md) | Example illustrating how to obtain the library version string | - + diff --git a/examples/libver.md b/examples/libver.md new file mode 100644 index 0000000..90fb6bc --- /dev/null +++ b/examples/libver.md @@ -0,0 +1,21 @@ +# Diagnosticism.Go - Example - **libver** + + +## Summary + +Displays the **Diagnosticism.Go** library version and terminates. + + +## Source + +See [examples/libver/main.go](./examples/libver/main.go). + + +## Execution + +```bash +go run ./examples/libver +``` + + + diff --git a/examples/log_with_custom_backend.md b/examples/log_with_custom_backend.md index a01c93c..97fe314 100644 --- a/examples/log_with_custom_backend.md +++ b/examples/log_with_custom_backend.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go - Example - **conrep_with_custom_backend** +# Diagnosticism.Go - Example - **log_with_custom_backend** ## Summary diff --git a/examples/logf_fail.md b/examples/logf_fail.md index 6871b5f..2dfcb71 100644 --- a/examples/logf_fail.md +++ b/examples/logf_fail.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go - Example - **flog_fail** +# Diagnosticism.Go - Example - **logf_fail** ## Summary diff --git a/examples/version.md b/examples/version.md index bc7be83..e1771a8 100644 --- a/examples/version.md +++ b/examples/version.md @@ -1,4 +1,4 @@ -# Diagnosticism.Go - Example - **tracing** +# Diagnosticism.Go - Example - **version** ## Summary From 43b197e6972d37d7c2d07db5da8cf17b6ec094c8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:33:40 +1000 Subject: [PATCH 20/43] 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 4e13be5a3a97c95fc0bc21de992a2fe4532c6748 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:43:19 +1000 Subject: [PATCH 21/43] 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 | 20 +++++++++++++++++--- .golangci.yml | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3eacb25..b89488f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -9,6 +9,7 @@ name: Go env: + GO_MIN_VERSION: '1.24' VERBOSITY: 1 on: @@ -39,9 +40,6 @@ jobs: - '1.26' - '1.25' - '1.24' - - '1.23' - - '1.22' - - '1.21' os: - macos-latest - ubuntu-latest @@ -65,3 +63,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 b986e120d2fde0992438373151b36782a9330cb6 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 16:59:23 +1000 Subject: [PATCH 22/43] 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 2bcc249..84a248e 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,9 @@ ## Packaging improvements -* \ +* [ ] Before the next official release: confirm **`go.mod`** (`go 1.24.0`) 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**; + * **STEGoL**; From 955df4fac9024f6cdfdb9222b909774b99634193 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 17:05:18 +1000 Subject: [PATCH 23/43] docs: normalise CHANGES.md version headings to SemVer form Replace parenthesized and dashed prerelease headings with hyphen-compact -alphaN/-betaN labels (ANGoLS, STEGoL, libCLImate.Go, Diagnosticism.Go). --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 3b6f2d5..c4ebe5d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -151,7 +151,7 @@ * ~ wholesale rename of ``diagnosticism`` => ``Diagnosticism`` -## 0.4.0 (unchanged) - 8th July 2019 +## 0.4.0 - 8th July 2019 * + added several examples From 3ca91ec7328dc92f6b227e57b88dda912b2bb28f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:51:22 +1000 Subject: [PATCH 24/43] dependencies --- go.mod | 16 +++++++--------- go.sum | 30 ++++++++++++------------------ 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 7d1adc5..7d036de 100644 --- a/go.mod +++ b/go.mod @@ -1,17 +1,15 @@ module github.com/synesissoftware/Diagnosticism.Go -go 1.24.0 +go 1.25.0 require ( - github.com/stretchr/testify v1.11.1 - github.com/synesissoftware/STEGoL v0.3.0 - github.com/synesissoftware/ver2go v0.1.3 - golang.org/x/term v0.40.0 + github.com/stretchr/testify v1.12.1 + github.com/synesissoftware/STEGoL v0.3.1 + github.com/synesissoftware/ver2go v0.1.4 + golang.org/x/term v0.45.0 ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.41.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/sys v0.47.0 // indirect ) diff --git a/go.sum b/go.sum index a393bf1..9e19cd9 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,12 @@ -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/STEGoL v0.3.0 h1:3Q1x7S472seaMlxBD1WR+Ax5qxDSFBb7jZ/EAUKQQTc= -github.com/synesissoftware/STEGoL v0.3.0/go.mod h1:TWWL9GPgKTuO2u3xGhCqYp7nvQbkxKq2vnjUJ2O8gSQ= -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= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= -golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= -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/STEGoL v0.3.1 h1:00VzAJX5WPt5BpJAffZ33qHeC2g6xjXM0uCgg5KjxbI= +github.com/synesissoftware/STEGoL v0.3.1/go.mod h1:rAfqnX1UANIy4/CSsXvyiodid68yHlUgo7i7atexrzE= +github.com/synesissoftware/ver2go v0.1.4 h1:IA0lzR+Wzv5WiwOj6XZJYZYQMq1xn75d6+PIAqqyapM= +github.com/synesissoftware/ver2go v0.1.4/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= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= From 408f7a2cd68bacfa51f192fefca3a9eceb0a5d1c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:51:27 +1000 Subject: [PATCH 25/43] version --- version.go | 2 +- version_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/version.go b/version.go index 73c713a..7c4fe40 100644 --- a/version.go +++ b/version.go @@ -14,7 +14,7 @@ import "github.com/synesissoftware/ver2go" const ( VersionMajor uint16 = 0 VersionMinor uint16 = 13 - VersionPatch uint16 = 4 + VersionPatch uint16 = 5 VersionAB uint16 = 0xFFFF Version uint64 = (uint64(VersionMajor) << 48) + (uint64(VersionMinor) << 32) + (uint64(VersionPatch) << 16) + (uint64(VersionAB) << 0) ) diff --git a/version_test.go b/version_test.go index a0a3b3f..fd1d9d3 100644 --- a/version_test.go +++ b/version_test.go @@ -11,7 +11,7 @@ import ( const ( Expected_VersionMajor uint16 = 0 Expected_VersionMinor uint16 = 13 - Expected_VersionPatch uint16 = 4 + Expected_VersionPatch uint16 = 5 Expected_VersionAB uint16 = 0xFFFF ) @@ -23,9 +23,9 @@ func Test_Version_Elements(t *testing.T) { } func Test_Version(t *testing.T) { - require.Equal(t, uint64(0x0000_000D_0004_FFFF), Version) + require.Equal(t, uint64(0x0000_000D_0005_FFFF), Version) } func Test_Version_String(t *testing.T) { - require.Equal(t, "0.13.4", VersionString()) + require.Equal(t, "0.13.5", VersionString()) } From c1f9453ab1676b80017bb2fe318b288d6ba42b38 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:51:41 +1000 Subject: [PATCH 26/43] CI fixes --- .github/workflows/go.yml | 1 + run_all_unit_tests.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b89488f..07e1a29 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -79,3 +79,4 @@ jobs: uses: golangci/golangci-lint-action@v6 with: args: --fast + verify: false 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 From 1ba4fa4b11db65a41d53adb2e62885ae9e529dd4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:51:46 +1000 Subject: [PATCH 27/43] Remove retired Go Report Card badge from README. Go Report Card is sunset; go.yml CI is the live quality signal. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e828bb4..2eb11ea 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Basic diagnostic facilities, for Go [![GitHub release](https://img.shields.io/github/v/release/synesissoftware/Diagnosticism.Go.svg)](https://github.com/synesissoftware/Diagnosticism.Go/releases/latest) [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/Diagnosticism.Go)](https://github.com/synesissoftware/Diagnosticism.Go/commits/master) [![Go](https://github.com/synesissoftware/Diagnosticism.Go/actions/workflows/go.yml/badge.svg)](https://github.com/synesissoftware/Diagnosticism.Go/actions/workflows/go.yml) -[![Go Report Card](https://goreportcard.com/badge/github.com/synesissoftware/Diagnosticism.Go)](https://goreportcard.com/report/github.com/synesissoftware/Diagnosticism.Go) [![Go Reference](https://pkg.go.dev/badge/github.com/synesissoftware/Diagnosticism.Go.svg)](https://pkg.go.dev/github.com/synesissoftware/Diagnosticism.Go) From 5f22f2f6a33f8a038431048b4a8270902e563aab Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:52:08 +1000 Subject: [PATCH 28/43] release --- CHANGES.md | 7 +++++++ NEWS.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c4ebe5d..6a5843f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,12 @@ # Diagnosticism.Go - Changes +## 0.13.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.13.5 release; ## 0.13.4 - 29th March 2026 diff --git a/NEWS.md b/NEWS.md index 16c690b..8f0a62d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ | Date | News Item | | ------------------- | ----------------------------------------------------------------------------------------------------------------- | -| 23rd August 2026 | Release of [**Diagnosticism.Go** 0.13.5](https://github.com/synesissoftware/Diagnosticism.Go/releases/tag/0.13.5) | +| 20th August 2026 | Release of [**Diagnosticism.Go** 0.13.5](https://github.com/synesissoftware/Diagnosticism.Go/releases/tag/0.13.5) | | 29th March 2026 | Release of [**Diagnosticism.Go** 0.13.4](https://github.com/synesissoftware/Diagnosticism.Go/releases/tag/0.13.4) | | 18th March 2026 | Release of **Diagnosticism.Go** 0.13.3 | | 18th March 2026 | Release of **Diagnosticism.Go** 0.13.2 | From e4f2a9c9c08090c65f9520b28ae4016417f3a79e Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:56:56 +1000 Subject: [PATCH 29/43] fix --- .github/workflows/go.yml | 5 ++--- CHANGES.md | 1 + TODO.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 07e1a29..9f5cdbd 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,13 +3,13 @@ # # Created: 18th August 2025 -# Updated: 19th August 2026 +# Updated: 20th August 2026 # name: Go env: - GO_MIN_VERSION: '1.24' + GO_MIN_VERSION: '1.25' VERBOSITY: 1 on: @@ -39,7 +39,6 @@ jobs: go-version: - '1.26' - '1.25' - - '1.24' os: - macos-latest - ubuntu-latest diff --git a/CHANGES.md b/CHANGES.md index 6a5843f..48c606d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ * CI modernisation (matrix + lint); * CI reliability fixes (macOS test linking; golangci-lint config verification disabled in CI); +* **`go.mod`** floor raised to **1.25** (dependency-driven; `golang.org/x/term` / `golang.org/x/sys`); * boilerplate additions (scripts, markdown docs, project identity); * removed retired Go Report Card badge from README; * version string updated for the 0.13.5 release; diff --git a/TODO.md b/TODO.md index 84a248e..6a5b3f4 100644 --- a/TODO.md +++ b/TODO.md @@ -20,7 +20,7 @@ ## Packaging improvements -* [ ] Before the next official release: confirm **`go.mod`** (`go 1.24.0`) 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: +* [ ] Before the next official release: confirm **`go.mod`** (`go 1.25.0`) 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**; * **STEGoL**; From 0426dbd91726331b243059b70952107798dc622b Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 08:59:28 +1000 Subject: [PATCH 30/43] fix --- .github/workflows/go.yml | 1 + .golangci.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9f5cdbd..a7c56ea 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -79,3 +79,4 @@ jobs: with: args: --fast verify: false + version: v2.4.0 diff --git a/.golangci.yml b/.golangci.yml index 600bef7..cd28989 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,2 +1,4 @@ run: timeout: 5m + +version: "2" From 79a89cadcf3aa7effd3151e39f6de654426b51a5 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:03:39 +1000 Subject: [PATCH 31/43] fix --- trace_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trace_test.go b/trace_test.go index c05ee37..522d49b 100644 --- a/trace_test.go +++ b/trace_test.go @@ -10,14 +10,14 @@ import ( func Test_EnableTracing(t *testing.T) { - go func() { + func() { current := d.EnableTracing(false) defer d.EnableTracing(current) require.False(t, current, "`EnableTracing()` should return `false` when first called") }() - go func() { + func() { current := d.EnableTracing(true) defer d.EnableTracing(current) From 111e6bdf43b6cb11c5df3ac4a10c25505616a0b1 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:05:32 +1000 Subject: [PATCH 32/43] fix --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a7c56ea..9609aea 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -75,7 +75,7 @@ jobs: go-version: '${{ env.GO_MIN_VERSION }}' - name: "Run golangci-lint" - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v7 with: args: --fast verify: false From 8aea93fe95b69cae41f375e6c1347163bf83de62 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:07:34 +1000 Subject: [PATCH 33/43] fix --- .github/workflows/go.yml | 1 - .golangci.yml | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9609aea..025db87 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -77,6 +77,5 @@ jobs: - name: "Run golangci-lint" uses: golangci/golangci-lint-action@v7 with: - args: --fast verify: false version: v2.4.0 diff --git a/.golangci.yml b/.golangci.yml index cd28989..b9d402f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,7 @@ +version: "2" + +linters: + default: fast + run: timeout: 5m - -version: "2" From b01d99e6112e7dd040728c3d259181432841b8fc Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:13:20 +1000 Subject: [PATCH 34/43] fix --- .golangci.yml | 19 +++- calc_doom_bench_test.go | 192 +++++++--------------------------------- 2 files changed, 47 insertions(+), 164 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index b9d402f..07590d4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,22 @@ -version: "2" - linters: default: fast + settings: + cyclop: + max-complexity: 10 + depguard: + rules: + main: + allow: + - $gostd + - github.com/stretchr/testify + - github.com/synesissoftware/Diagnosticism.Go + - github.com/synesissoftware/STEGoL + - github.com/synesissoftware/ver2go + - go.yaml.in/yaml/v3 + - golang.org/x/ + list-mode: lax run: timeout: 5m + +version: "2" diff --git a/calc_doom_bench_test.go b/calc_doom_bench_test.go index ffef515..805f84b 100644 --- a/calc_doom_bench_test.go +++ b/calc_doom_bench_test.go @@ -12,169 +12,37 @@ import ( func Test_calc_doom(t *testing.T) { - { - v := calc_doom(0) + stegol.CheckIntegerEqual(t, 0, calc_doom(0)) - stegol.CheckIntegerEqual(t, 0, v) - } - - { - for i := uint64(1); i != 10; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 1, v) - } - } - - { - for i := uint64(10); i != 100; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 2, v) - } - } - - { - for i := uint64(100); i != 1_000; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 3, v) - } - } - - { - for i := uint64(1_000); i != 10_000; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 4, v) - } - } - - { - for i := uint64(10_000); i != 100_000; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 5, v) - } - } - - { - for i := uint64(100_000); i != 1_000_000; i++ { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 6, v) - } - } - - { - for i := uint64(1_000_000); i != 10_000_000; i += 1_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 7, v) - } - } - - { - for i := uint64(10_000_000); i != 100_000_000; i += 10_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 8, v) - } - } - - { - for i := uint64(100_000_000); i != 1_000_000_000; i += 100_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 9, v) - } - } - - { - for i := uint64(1_000_000_000); i != 10_000_000_000; i += 1_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 10, v) - } - } - - { - for i := uint64(10_000_000_000); i != 100_000_000_000; i += 10_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 11, v) - } - } - - { - for i := uint64(100_000_000_000); i != 1_000_000_000_000; i += 100_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 12, v) - } - } - - { - for i := uint64(1_000_000_000_000); i != 10_000_000_000_000; i += 1_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 13, v) - } - } - - { - for i := uint64(10_000_000_000_000); i != 100_000_000_000_000; i += 10_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 14, v) - } - } - - { - for i := uint64(100_000_000_000_000); i != 1_000_000_000_000_000; i += 100_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 15, v) - } - } - - { - for i := uint64(1_000_000_000_000_000); i != 10_000_000_000_000_000; i += 1_000_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 16, v) - } - } - - { - for i := uint64(10_000_000_000_000_000); i != 100_000_000_000_000_000; i += 10_000_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 17, v) - } - } - - { - for i := uint64(100_000_000_000_000_000); i != 1_000_000_000_000_000_000; i += 100_000_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 18, v) - } - } - - { - for i := uint64(1_000_000_000_000_000_000); i != 10_000_000_000_000_000_000; i += 1_000_000_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 19, v) - } - } - - { - for i := uint64(10_000_000_000_000_000_000); i != 18_000_000_000_000_000_000; i += 1_000_000_000_000_000_000 { - v := calc_doom(i) - - stegol.CheckIntegerEqual(t, 20, v) + cases := []struct { + from, to, step uint64 + want uint32 + }{ + {1, 10, 1, 1}, + {10, 100, 1, 2}, + {100, 1_000, 1, 3}, + {1_000, 10_000, 1, 4}, + {10_000, 100_000, 1, 5}, + {100_000, 1_000_000, 1, 6}, + {1_000_000, 10_000_000, 1_000_000, 7}, + {10_000_000, 100_000_000, 10_000_000, 8}, + {100_000_000, 1_000_000_000, 100_000_000, 9}, + {1_000_000_000, 10_000_000_000, 1_000_000_000, 10}, + {10_000_000_000, 100_000_000_000, 10_000_000_000, 11}, + {100_000_000_000, 1_000_000_000_000, 100_000_000_000, 12}, + {1_000_000_000_000, 10_000_000_000_000, 1_000_000_000_000, 13}, + {10_000_000_000_000, 100_000_000_000_000, 10_000_000_000_000, 14}, + {100_000_000_000_000, 1_000_000_000_000_000, 100_000_000_000_000, 15}, + {1_000_000_000_000_000, 10_000_000_000_000_000, 1_000_000_000_000_000, 16}, + {10_000_000_000_000_000, 100_000_000_000_000_000, 10_000_000_000_000_000, 17}, + {100_000_000_000_000_000, 1_000_000_000_000_000_000, 100_000_000_000_000_000, 18}, + {1_000_000_000_000_000_000, 10_000_000_000_000_000_000, 1_000_000_000_000_000_000, 19}, + {10_000_000_000_000_000_000, 18_000_000_000_000_000_000, 1_000_000_000_000_000_000, 20}, + } + + for _, tc := range cases { + for i := tc.from; i != tc.to; i += tc.step { + stegol.CheckIntegerEqual(t, tc.want, calc_doom(i)) } } } From 637517d6832f73c25b6eba657bc80a4457c0f692 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:42:18 +1000 Subject: [PATCH 35/43] fix: lint suppressions --- doomgram.go | 1 + severity/severity.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doomgram.go b/doomgram.go index 4c22ca1..f9b631e 100644 --- a/doomgram.go +++ b/doomgram.go @@ -233,6 +233,7 @@ func (d *DOOMGram) PushEventTimeS(time_in_s uint64) bool { } } +//nolint:gocyclo func (d *DOOMGram) pushEventTimeNs_(time_in_ns uint64) { if time_in_ns >= 1_000_000 { // >= 1ms diff --git a/severity/severity.go b/severity/severity.go index c4f50a2..8f377b4 100644 --- a/severity/severity.go +++ b/severity/severity.go @@ -97,6 +97,8 @@ func (dt defaultSeverityTranslator) SeverityToString(severity Severity) string { */ // Obtains the coloured stock string form of a given [Severity]. +// +//nolint:gocyclo func ColouredSeverityToString(severity Severity) string { switch severity { @@ -150,6 +152,8 @@ func ColouredSeverityToString(severity Severity) string { } // Obtains the stock string form of a given [Severity]. +// +//nolint:gocyclo func TranslateStockSeverity(severity Severity) string { switch severity { From 11e5e900ac08ad19262b9360f8687a16964861bc Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:47:17 +1000 Subject: [PATCH 36/43] fix --- doomgram.go | 2 +- severity/severity.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doomgram.go b/doomgram.go index f9b631e..007ecc4 100644 --- a/doomgram.go +++ b/doomgram.go @@ -233,7 +233,7 @@ func (d *DOOMGram) PushEventTimeS(time_in_s uint64) bool { } } -//nolint:gocyclo +//nolint:cyclop func (d *DOOMGram) pushEventTimeNs_(time_in_ns uint64) { if time_in_ns >= 1_000_000 { // >= 1ms diff --git a/severity/severity.go b/severity/severity.go index 8f377b4..4ebf850 100644 --- a/severity/severity.go +++ b/severity/severity.go @@ -98,7 +98,7 @@ func (dt defaultSeverityTranslator) SeverityToString(severity Severity) string { // Obtains the coloured stock string form of a given [Severity]. // -//nolint:gocyclo +//nolint:cyclop func ColouredSeverityToString(severity Severity) string { switch severity { @@ -153,7 +153,7 @@ func ColouredSeverityToString(severity Severity) string { // Obtains the stock string form of a given [Severity]. // -//nolint:gocyclo +//nolint:cyclop func TranslateStockSeverity(severity Severity) string { switch severity { From a160b895a3143e45a5f4898c59809e281dd5c1a4 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:49:14 +1000 Subject: [PATCH 37/43] fix --- internal/debug.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/debug.go b/internal/debug.go index 8329065..44fc4b8 100644 --- a/internal/debug.go +++ b/internal/debug.go @@ -39,7 +39,7 @@ func getFileLineFunction(depth int, wantFunction bool) (string, int, string, boo // Obtains the file information for the calling function. func File(depth int) string { - file, _, _, _ := getFileLineFunction(depth+1, false) + file, _, _, _ := getFileLineFunction(depth+1, false) //nolint:dogsled return file } @@ -73,7 +73,7 @@ func FileLineFunction(depth int) string { // function. func Function(depth int) string { - _, _, function, _ := getFileLineFunction(depth+1, true) + _, _, function, _ := getFileLineFunction(depth+1, true) //nolint:dogsled return function } From f5a8a8032e8fbba0150d89c02674f2bcb0519b06 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:52:12 +1000 Subject: [PATCH 38/43] fix --- doomgram_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/doomgram_test.go b/doomgram_test.go index acd0331..f5368a7 100644 --- a/doomgram_test.go +++ b/doomgram_test.go @@ -1,3 +1,4 @@ +//nolint:dupl // parallel timing fixtures ported from Diagnosticism.Rust package diagnosticism_test import ( From 804b2ee69a98c5c1dd4cfa067609c4ce1d40cbf3 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:53:48 +1000 Subject: [PATCH 39/43] fix --- itoa_thousands_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/itoa_thousands_test.go b/itoa_thousands_test.go index 2ccd486..3c7c7a5 100644 --- a/itoa_thousands_test.go +++ b/itoa_thousands_test.go @@ -1,3 +1,4 @@ +//nolint:dupl // parallel int / int64 test tables package diagnosticism_test import ( From 2c5e363244bae5e2578bbcfbcfa609db13be11c8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:55:46 +1000 Subject: [PATCH 40/43] fix --- severity/severity_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/severity/severity_test.go b/severity/severity_test.go index dc3d65e..218198e 100644 --- a/severity/severity_test.go +++ b/severity/severity_test.go @@ -1,3 +1,4 @@ +//nolint:dupl // parallel stock / coloured severity assertion tables package severity_test import ( From 9f5214d24f316276da920e71206d71494bf30ba2 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 09:59:14 +1000 Subject: [PATCH 41/43] fix --- .golangci.yml | 31 +++++++++++++++++++++++++++++++ conrep.go | 6 +++--- doomgram.go | 7 +++---- doomgram_test.go | 1 - internal/debug.go | 16 +++------------- itoa_thousands.go | 4 +++- itoa_thousands_test.go | 1 - loghandler.go | 17 +++++++++-------- severity/severity.go | 7 ++----- severity/severity_test.go | 1 - trace.go | 6 +++--- version.go | 2 +- 12 files changed, 58 insertions(+), 41 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 07590d4..fb6d507 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,36 @@ linters: default: fast + disable: + - whitespace + - wsl + exclusions: + rules: + - linters: + - dupl + - funlen + - testpackage + path: _test\.go + - linters: + - cyclop + - funcorder + - funlen + - gocognit + - mnd + - nestif + path: doomgram\.go + - linters: + - lll + - mnd + path: examples/ + - linters: + - mnd + path: itoa_thousands\.go + - linters: + - gochecknoinits + path: severity/severity\.go + - linters: + - mnd + path: version\.go settings: cyclop: max-complexity: 10 diff --git a/conrep.go b/conrep.go index 350ae29..10a61fa 100644 --- a/conrep.go +++ b/conrep.go @@ -4,11 +4,11 @@ * Purpose: Contingent report API for Diagnosticism.Go * * Created: 31st May 2019 - * Updated: 26th August 2025 + * Updated: 20th August 2026 * * Home: https://github.com/synesissoftware/Diagnosticism.Go * - * Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems + * Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,7 +63,7 @@ var contingentReportWriter io.Writer = os.Stderr * helper functions */ -// TODO: separate this out using proper build constraints +// Future: separate this out using proper build constraints. func osIsWindows() bool { if ';' != os.PathListSeparator { diff --git a/doomgram.go b/doomgram.go index 007ecc4..3d7f696 100644 --- a/doomgram.go +++ b/doomgram.go @@ -4,7 +4,7 @@ /* * Created: 25th March 2025 - * Updated: 18th March 2026 + * Updated: 20th August 2026 */ package diagnosticism @@ -233,7 +233,6 @@ func (d *DOOMGram) PushEventTimeS(time_in_s uint64) bool { } } -//nolint:cyclop func (d *DOOMGram) pushEventTimeNs_(time_in_ns uint64) { if time_in_ns >= 1_000_000 { // >= 1ms @@ -317,7 +316,7 @@ func (d *DOOMGram) tryAddNsToTotalAndUpdateMinmaxAndCount(time_in_ns uint64) boo } } -// NOTE: taken directly from Diagnosticism.Rust +// NOTE: taken directly from Diagnosticism.Rust. func calc_doom(v uint64) uint32 { if v >= 100_000_000 { @@ -410,7 +409,7 @@ func calc_doom(v uint64) uint32 { } } -// NOTE: taken directly from Diagnosticism.Rust +// NOTE: taken directly from Diagnosticism.Rust. func gram_doom_to_char( doom uint32, ch_0 byte, diff --git a/doomgram_test.go b/doomgram_test.go index f5368a7..acd0331 100644 --- a/doomgram_test.go +++ b/doomgram_test.go @@ -1,4 +1,3 @@ -//nolint:dupl // parallel timing fixtures ported from Diagnosticism.Rust package diagnosticism_test import ( diff --git a/internal/debug.go b/internal/debug.go index 44fc4b8..6df19f2 100644 --- a/internal/debug.go +++ b/internal/debug.go @@ -1,10 +1,10 @@ -// Copyright 2019-2025 Matthew Wilson and Synesis Information Systems. All +// Copyright 2019-2026 Matthew Wilson and Synesis Information Systems. All // rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* * Created: 22nd February 2025 - * Updated: 20th December 2025 + * Updated: 20th August 2026 */ package internal @@ -15,20 +15,16 @@ import ( ) func getFileLineFunction(depth int, wantFunction bool) (string, int, string, bool) { - - // TODO: refactor in terms of `CallersFrames()` + // Future: refactor in terms of `CallersFrames()`. pc, file, line, ok := runtime.Caller(depth + 1) if ok { - if wantFunction { - function := runtime.FuncForPC(pc).Name() return file, line, function, true } else { - return file, line, "", true } } else { @@ -38,7 +34,6 @@ func getFileLineFunction(depth int, wantFunction bool) (string, int, string, boo // Obtains the file information for the calling function. func File(depth int) string { - file, _, _, _ := getFileLineFunction(depth+1, false) //nolint:dogsled return file @@ -46,7 +41,6 @@ func File(depth int) string { // Obtains the file and line information for the calling function. func FileLine(depth int) string { - file, line, _, ok := getFileLineFunction(depth+1, false) if ok { @@ -59,7 +53,6 @@ func FileLine(depth int) string { // Obtains the file, line, and function information for the calling // function. func FileLineFunction(depth int) string { - file, line, function, ok := getFileLineFunction(depth+1, true) if ok { @@ -72,7 +65,6 @@ func FileLineFunction(depth int) string { // Obtains the file, line, and function information for the calling // function. func Function(depth int) string { - _, _, function, _ := getFileLineFunction(depth+1, true) //nolint:dogsled return function @@ -80,7 +72,6 @@ func Function(depth int) string { // Obtains the line function information for the calling function. func Line(depth int) int { - _, line, _, ok := getFileLineFunction(depth+1, false) if ok { @@ -92,7 +83,6 @@ func Line(depth int) int { // Obtains the line and function information for the calling function. func LineFunction(depth int) string { - _, line, function, ok := getFileLineFunction(depth+1, true) if ok { diff --git a/itoa_thousands.go b/itoa_thousands.go index 660dfe1..1d3fc46 100644 --- a/itoa_thousands.go +++ b/itoa_thousands.go @@ -70,7 +70,9 @@ func itoaThousands_uint64(v uint64) string { } // Returns the string form of v in base 10, with thousands separators. -func ItoaThousands[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr](v T) string { +func ItoaThousands[T int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr]( + v T, +) string { switch any(v).(type) { case int, int8, int16, int32, int64: diff --git a/itoa_thousands_test.go b/itoa_thousands_test.go index 3c7c7a5..2ccd486 100644 --- a/itoa_thousands_test.go +++ b/itoa_thousands_test.go @@ -1,4 +1,3 @@ -//nolint:dupl // parallel int / int64 test tables package diagnosticism_test import ( diff --git a/loghandler.go b/loghandler.go index 2473d35..79ba7ef 100644 --- a/loghandler.go +++ b/loghandler.go @@ -4,7 +4,7 @@ * Purpose: LogHandler for Diagnosticism.Go * * Created: 1st June 2019 - * Updated: 1st March 2026 + * Updated: 20th August 2026 * * Home: https://github.com/synesissoftware/Diagnosticism.Go * @@ -53,18 +53,18 @@ type LogRequestFlags int const ( - // Do not log before the request + // Do not log before the request. LogRequest_NotBefore LogRequestFlags = 1 << iota - // Do not log after the request + // Do not log after the request. LogRequest_NotAfter LogRequestFlags = 1 << iota - // Do not include a BEFORE/AFTER prefix + // Do not include a BEFORE/AFTER prefix. LogRequest_NoWhenLabel LogRequestFlags = 1 << iota - // Do not include the method + // Do not include the method. LogRequest_NotMethod LogRequestFlags = 1 << iota - // Do not include the URL + // Do not include the URL. LogRequest_NotURL LogRequestFlags = 1 << iota - // Include the protocol + // Include the protocol. LogRequest_Protocol LogRequestFlags = 1 << iota ) @@ -164,7 +164,8 @@ func parseSeverityFromArgs(options ...any) severity.Severity { // - +options+ Optional arguments (see below) // // Options: -// - * (severity.Severity) The first option of this type is used for before and/or after logging; if none specified, before and/or after logging is done using severity.Informational +// - * (severity.Severity) The first option of this type is used for before and/or after logging; +// if none specified, before and/or after logging is done using severity.Informational. func LogRequest(flags LogRequestFlags, options ...any) func(http.Handler) http.Handler { sev := parseSeverityFromArgs(options) diff --git a/severity/severity.go b/severity/severity.go index 4ebf850..24312d6 100644 --- a/severity/severity.go +++ b/severity/severity.go @@ -1,10 +1,10 @@ -// Copyright 2019-2025 Matthew Wilson and Synesis Information Systems. All +// Copyright 2019-2026 Matthew Wilson and Synesis Information Systems. All // rights reserved. Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* * Created: 30th May 2019 - * Updated: 3rd September 2025 + * Updated: 20th August 2026 */ package severity @@ -25,7 +25,6 @@ type Severity int // Default string form of the stock severity levels. func (severity Severity) String() string { - return severityTranslator.SeverityToString(severity) } @@ -81,14 +80,12 @@ var severityTranslator SeverityTranslator type colouredSeverityTranslator struct{} func (dt colouredSeverityTranslator) SeverityToString(severity Severity) string { - return ColouredSeverityToString(severity) } type defaultSeverityTranslator struct{} func (dt defaultSeverityTranslator) SeverityToString(severity Severity) string { - return TranslateStockSeverity(severity) } diff --git a/severity/severity_test.go b/severity/severity_test.go index 218198e..dc3d65e 100644 --- a/severity/severity_test.go +++ b/severity/severity_test.go @@ -1,4 +1,3 @@ -//nolint:dupl // parallel stock / coloured severity assertion tables package severity_test import ( diff --git a/trace.go b/trace.go index a74776f..23a160c 100644 --- a/trace.go +++ b/trace.go @@ -4,7 +4,7 @@ /* * Created: 5th March 2019 - * Updated: 14th March 2026 + * Updated: 20th August 2026 */ package diagnosticism @@ -39,7 +39,7 @@ type TraceArgumentFlags int64 const ( None TraceArgumentFlags = 0 // No flags specified NameOnly TraceArgumentFlags = 0x0000_0000_0000_0001 // Does not trace the value of a function parameter. - NameTypeOnly TraceArgumentFlags = 0x0000_0000_0000_0002 // Does not trace the type or the value of a function parameter. + NameTypeOnly TraceArgumentFlags = 0x0000_0000_0000_0002 // Does not trace type or value of a parameter. TruncateValue TraceArgumentFlags = 0x0000_0000_0000_0004 // Causes the value to be truncated to 20 runes. ) @@ -136,7 +136,7 @@ func TrargTrunc(name string, value any) TraceArgument { // // The first parameter `function_name` is a string, and the remaining // parameters are a variable length list of TraceArgument instances, which -// may be created using the `Trarg()` and `TrargNameOnly()` functions +// may be created using the `Trarg()` and `TrargNameOnly()` functions. func Trace(function_name string, args ...TraceArgument) { if !enableTracing { diff --git a/version.go b/version.go index 7c4fe40..527ba2a 100644 --- a/version.go +++ b/version.go @@ -4,7 +4,7 @@ /* * Created: 5th March 2019 - * Updated: 29th March 2026 + * Updated: 20th August 2026 */ package diagnosticism From e7089f06486d2208dc131cd988957eaeaf4760fb Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 14:41:07 +1000 Subject: [PATCH 42/43] Enforce Synesis Go import order via gci and reformat existing files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add module- and examples-scoped gci configuration (local → third- arty → stdlib; examples use non-stdlib → stdlib) and align import blocks in tests and the libver example with that layout. --- .golangci.yml | 10 ++++++++++ debug.go | 4 ++-- examples/.golangci.yml | 16 ++++++++++++++++ itoa_thousands_test.go | 4 ++-- severity/severity.go | 4 ++-- 5 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 examples/.golangci.yml diff --git a/.golangci.yml b/.golangci.yml index fb6d507..1264df5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,6 +3,8 @@ linters: disable: - whitespace - wsl + enable: + - gci exclusions: rules: - linters: @@ -46,6 +48,14 @@ linters: - go.yaml.in/yaml/v3 - golang.org/x/ list-mode: lax + gci: + custom-order: true + no-inline-comments: false + no-prefix-comments: false + sections: + - prefix(github.com/synesissoftware/Diagnosticism.Go) + - default + - standard run: timeout: 5m diff --git a/debug.go b/debug.go index 22be0e3..9179832 100644 --- a/debug.go +++ b/debug.go @@ -10,9 +10,9 @@ package diagnosticism import ( - "errors" - "github.com/synesissoftware/Diagnosticism.Go/internal" + + "errors" ) var ( diff --git a/examples/.golangci.yml b/examples/.golangci.yml new file mode 100644 index 0000000..582524c --- /dev/null +++ b/examples/.golangci.yml @@ -0,0 +1,16 @@ +linters: + enable: + - gci + settings: + gci: + custom-order: true + no-inline-comments: false + no-prefix-comments: false + sections: + - default + - standard + +run: + timeout: 5m + +version: "2" diff --git a/itoa_thousands_test.go b/itoa_thousands_test.go index 2ccd486..c4852fd 100644 --- a/itoa_thousands_test.go +++ b/itoa_thousands_test.go @@ -3,9 +3,9 @@ package diagnosticism_test import ( d "github.com/synesissoftware/Diagnosticism.Go" - "testing" - "github.com/stretchr/testify/assert" + + "testing" ) func Test_ItoaThousands_int(t *testing.T) { diff --git a/severity/severity.go b/severity/severity.go index 24312d6..b96ea61 100644 --- a/severity/severity.go +++ b/severity/severity.go @@ -10,10 +10,10 @@ package severity import ( + "golang.org/x/term" + "fmt" "os" - - "golang.org/x/term" ) /* ///////////////////////////////////////////////////////////////////////// From 2e182df509c4724d0e42d5d01edd71d2be249c60 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Thu, 20 Aug 2026 14:46:27 +1000 Subject: [PATCH 43/43] Enforce Synesis Go import order via gci and reformat existing files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add module- and examples-scoped gci configuration (local → third-party → stdlib; examples use non-stdlib → stdlib) and align import blocks in tests and the libver example with that layout. --- .golangci.yml | 27 +++++++++++++++++---------- examples/.golangci.yml | 2 +- itoa_thousands.go | 4 ++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1264df5..72f8962 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,10 +1,24 @@ +formatters: + enable: + - gci + exclusions: + paths: + - examples/ + settings: + gci: + custom-order: true + no-inline-comments: false + no-prefix-comments: false + sections: + - prefix(github.com/synesissoftware/Diagnosticism.Go) + - default + - standard + linters: default: fast disable: - whitespace - wsl - enable: - - gci exclusions: rules: - linters: @@ -31,6 +45,7 @@ linters: - gochecknoinits path: severity/severity\.go - linters: + - lll - mnd path: version\.go settings: @@ -48,14 +63,6 @@ linters: - go.yaml.in/yaml/v3 - golang.org/x/ list-mode: lax - gci: - custom-order: true - no-inline-comments: false - no-prefix-comments: false - sections: - - prefix(github.com/synesissoftware/Diagnosticism.Go) - - default - - standard run: timeout: 5m diff --git a/examples/.golangci.yml b/examples/.golangci.yml index 582524c..3a28ebe 100644 --- a/examples/.golangci.yml +++ b/examples/.golangci.yml @@ -1,4 +1,4 @@ -linters: +formatters: enable: - gci settings: diff --git a/itoa_thousands.go b/itoa_thousands.go index 1d3fc46..5792d55 100644 --- a/itoa_thousands.go +++ b/itoa_thousands.go @@ -9,7 +9,7 @@ func itoaThousands_int64(v int64) string { s := strconv.FormatInt(v, 10) - r := make([]byte, 0, len(s) * 4 / 3) + r := make([]byte, 0, len(s)*4/3) if neg { s = s[1:] @@ -43,7 +43,7 @@ func itoaThousands_int64(v int64) string { func itoaThousands_uint64(v uint64) string { s := strconv.FormatUint(v, 10) - r := make([]byte, 0, len(s) * 4 / 3) + r := make([]byte, 0, len(s)*4/3) var n int switch len(s) % 3 {