diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a3a3b41..c34b6d1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -3,21 +3,22 @@ # # Created: 18th August 2025 -# Updated: 3rd August 2026 +# Updated: 19th August 2026 # name: Go env: + GO_MIN_VERSION: '1.21' VERBOSITY: 1 on: push: branches: - - boilerplate + - master - dev + - boilerplate - idiomatic - - master - rc1 - rc2 - rc3 @@ -65,3 +66,20 @@ 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 + verify: false diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..100b133 --- /dev/null +++ b/.golangci.yml @@ -0,0 +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/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. + + + diff --git a/CHANGES.md b/CHANGES.md index 3c0ea79..21a5bdb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,23 @@ -# recls.Go - CHANGES +# 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 @@ -14,4 +33,3 @@ - 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/NEWS.md b/NEWS.md index e69de29..9f090f7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -0,0 +1,12 @@ +# recls.Go - News + + +| Date | News Item | +| ---------------- | --------------------------------------------------------------------------------------------------- | +| 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 da5150c..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) @@ -83,3 +82,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. + + + diff --git a/TODO.md b/TODO.md index c4a9455..901556f 100644 --- a/TODO.md +++ b/TODO.md @@ -1,20 +1,27 @@ # 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 + +* [ ] 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**; + + + 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/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 +``` + + + diff --git a/go.mod b/go.mod index 0a58c84..27fad2a 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,10 @@ module github.com/synesissoftware/recls.Go -go 1.23.6 +go 1.21 require ( - github.com/stretchr/testify v1.10.0 - github.com/synesissoftware/ver2go v0.1.2 + 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 0a67060..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.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= -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()) }