Skip to content

v0.1.0 - Initial Release

Choose a tag to compare

@amery amery released this 10 Aug 19:11
· 11 commits to main since this release
7f794d7

Release v0.1.0 - Initial Release

Date: 2025-08-10
Tag: v0.1.0

Overview

Initial release of protomcp.org/common - a shared utilities library
providing common functionality for protomcp.org projects including nanorpc
and protomcp.

Features

Core Utilities

Slices Package

Generic slice utilities designed to prevent memory leaks when working with
slices containing pointers or reference types:

  • ClearSlice: Zeros all elements and returns empty slice for reuse.
  • ClearAndNilSlice: Zeros all elements and returns nil for garbage
    collection.
  • Full test coverage with benchmarks.

LazyBuffer Package

Efficient string building utility ported from protomcp/pkg/generator:

  • Chainable methods: WriteString, WriteRunes, Printf.
  • Nil-safe operations - all methods handle nil receivers gracefully.
  • Empty string filtering in WriteString.
  • Methods: Len(), Reset(), String().
  • Performance optimised with benchmarks.

Build System

Comprehensive build infrastructure imported from darvaza.org/slog:

  • Makefile: Full build cycle with targets for test, coverage, lint, and
    tidy.
  • CI/CD: GitHub Actions workflows for testing, race detection, and
    coverage.
  • Quality Tools:
    • golangci-lint v2.3.0 for Go code linting.
    • revive for additional Go analysis.
    • markdownlint for documentation formatting.
    • shellcheck for shell script validation.
    • cspell for spell checking.
    • languagetool for grammar checking.

Testing & Documentation

  • 100% test coverage across all packages.
  • Comprehensive table-driven tests.
  • Performance benchmarks for critical functions.
  • Full API documentation in doc.go.
  • Developer guidelines in AGENT.md.
  • Usage examples in README.md.

Changes Summary

Commits (7 total)

  1. d350a97 - feat: initialize common repository for shared utilities.
  2. 2a42a52 - Remove testutils package (delegated to darvaza.org/core).
  3. d214c26 - build: Import build system improvements from darvaza.org/slog.
  4. 93ceb40 - feat(slices): add slice utilities for memory leak prevention.
  5. 39c3d2b - feat(lazybuffer): add LazyBuffer string building utility.
  6. 07ec344 - fix: Correct typo in email address in LICENCE.txt.
  7. 7f794d7 - Merge pull request #1: Add Common Utilities Package.

Files Added

  • Core packages: slices.go, lazybuffer.go, doc.go.
  • Tests: slices_test.go, lazybuffer_test.go.
  • Build: Makefile, .golangci.yml, .editorconfig.
  • CI/CD: .github/workflows/ (go.yml, codecov.yml, race.yml).
  • Documentation: README.md, AGENT.md, LICENCE.txt.
  • Configuration: go.mod, go.sum, renovate.json.

Dependencies

  • Go 1.23 or later.
  • darvaza.org/core v0.3.10 (for testing utilities).

Installation

go get protomcp.org/common@v0.1.0

Usage Example

import "protomcp.org/common"

// Using LazyBuffer for string building
buf := &common.LazyBuffer{}
buf.WriteString("Hello ").WriteString("World").Printf("! Count: %d", 42)
result := buf.String() // "Hello World! Count: 42"

// Using slice utilities to prevent memory leaks
data := make([]*BigStruct, 0, 1000)
// ... use data ...
data = common.ClearSlice(data) // Safely clear and reuse

Contributors

  • Alejandro Mery (@amery) - Initial implementation and build system.

Notes

This is the foundation release establishing the common utilities package for
the protomcp.org ecosystem. The package focuses on providing battle-tested,
well-documented utilities that are used across multiple protomcp.org
repositories.

Next Steps

Future releases may include:

  • Additional utility functions based on ecosystem needs.
  • Performance optimisations.
  • Extended documentation and examples.

For questions or issues, please open an issue on the repository.