Skip to content

docs: standardize API documentation across all packages#2

Merged
leaxoy merged 1 commit into
mainfrom
docs/standardize-api-docs
Mar 13, 2026
Merged

docs: standardize API documentation across all packages#2
leaxoy merged 1 commit into
mainfrom
docs/standardize-api-docs

Conversation

@leaxoy
Copy link
Copy Markdown
Contributor

@leaxoy leaxoy commented Mar 13, 2026

Summary

This PR standardizes API documentation across all packages in the ds library:

Changes Made

  1. Added doc.go files for all packages with comprehensive package-level documentation including:

    • Time complexity for all operations
    • Features list
    • Usage examples
    • Use cases
    • Performance notes
  2. Standardized iterator function documentation across all packages:

    • btree, btreemap, btreeset
    • skipmap, skipset
    • hashmap, hashset
    • arraydeque, arraystack, linkedlist
    • trie
  3. Consistent documentation structure:

    • One-line description
    • Parameters: section
    • Returns: section with return type description
    • Time Complexity: for all operations
    • Behavior: section when applicable
  4. Test improvements:

    • Replaced custom comparators with cmp.Compare / NewOrdered constructors
    • Removed unused test helper functions
  5. Linter fixes:

    • Fixed ineffassign issues
    • Removed deprecated rand.Seed calls

Files Changed

  • 15 new doc.go files added
  • 36 files modified with standardized documentation

Testing

All tests pass:

go build ./... && go test ./...

- Add doc.go files for all packages with consistent documentation style
- Move package-level docs to doc.go files
- Standardize iterator function docs with Parameters, Returns, Time Complexity sections
- Replace custom comparators with cmp.Compare/Ordered constructors in tests
- Fix linter issues (ineffassign, deprecated rand.Seed)
- Remove unused code (unused private functions)
@leaxoy leaxoy merged commit 2605483 into main Mar 13, 2026
2 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.

1 participant