Skip to content

chore: prepare comparator as a stdlib-only open-source Go library - #1

Merged
christiangda merged 5 commits into
mainfrom
chore/open-source-library-scaffolding
Jul 23, 2026
Merged

chore: prepare comparator as a stdlib-only open-source Go library#1
christiangda merged 5 commits into
mainfrom
chore/open-source-library-scaffolding

Conversation

@christiangda

Copy link
Copy Markdown
Contributor

Summary

Prepares comparator to be published as a proper open-source Go library, modeled on the structure of slashdevops/e5t. The library targets Go 1.26 and now depends on the Go standard library only — no third-party modules.

Changes

🧹 Stdlib-only + best practices

  • Removed the external github.com/aizon-shared/ds-utils/pkg/testutils dependency (its single use is replaced with clearly-marked inline test values). Verified with go list -deps — zero external dependencies.
  • Modernized benchmarks to the Go 1.24+ for b.Loop() form, dropping redundant b.ResetTimer() calls.
  • Follows the Google Go Style Guide (uses any, small focused funcs, documented API).

📖 Documentation

  • Renamed docs.godoc.go (conventional package-doc filename).
  • Rewrote the README.md: CI / Go Reference / Go Report Card / license / release badges, emoji section headers, go get install & update instructions, correct github.com/slashdevops/comparator module path, and links into the docs.
  • Added an extensive docs/ folder: getting-started, configuration, diffing, output-formats, json-patch, custom-comparators, performance, and FAQ.
  • Added runnable Example functions for the options and package-level API (comparator_options_examples_test.go), all verified by go test.

⚙️ Open-source scaffolding & CI/CD

  • Apache-2.0 LICENSE, SECURITY.md, .gitignore, .golangci.yaml, .vscode/settings.json.
  • .github/ metadata: Dependabot, release-notes config, Copilot instructions, CodeQL config.
  • GitHub Actions: main.yml, pr.yml, release.yml, and codeql.yml.

Verification

gofmt -l .        # clean
go vet ./...      # clean
go build ./...    # ok
go test -race ./... -covermode=atomic   # PASS, 87.9% coverage
go list -deps ... # no external deps

🤖 Generated with Claude Code

christiangda and others added 5 commits July 23, 2026 15:49
Drop the github.com/aizon-shared/ds-utils/pkg/testutils import so the
module depends only on the Go standard library, replacing its single use
with clearly-marked inline test values. Modernize the benchmarks to the
Go 1.24+ `for b.Loop()` form, which also removes the redundant
b.ResetTimer() calls.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Match the conventional single doc.go filename used by idiomatic Go
libraries for package-level documentation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add runnable Example functions covering Equal, DeepEqual, GetJSONPatch,
GetUnifiedDiff, GetVisualDiff, FormatDiff, and the configuration options
(float precision, field/unexported ignoring, empty/NaN equality, custom
comparators, and time layout). All render on pkg.go.dev and are verified
by `go test`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rewrite the README with CI/reference/report/license/release badges,
emoji section headers, `go get` install/update instructions, and the
correct github.com/slashdevops/comparator module path. Add a docs/ folder
with getting-started, configuration, diffing, output-formats, json-patch,
custom-comparators, performance, and FAQ guides, all linked from the
README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the standard scaffolding for a public Go library: Apache-2.0 LICENSE,
SECURITY.md, .gitignore, golangci-lint config, editor settings, and
GitHub metadata (Dependabot, release notes, copilot instructions). Add
GitHub Actions for main, pull requests, tagged releases, and CodeQL
security analysis.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christiangda christiangda self-assigned this Jul 23, 2026
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@christiangda
christiangda merged commit ac8fc9e into main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants