Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 24, 2025

This PR contains the following updates:

Package Change Age Confidence
github.com/cweill/gotests v1.7.4 -> v1.8.0 age confidence

Release Notes

cweill/gotests (github.com/cweill/gotests)

v1.8.0: - Full Go Generics Support

Compare Source

🎉 Full Go Generics Support

This release adds complete support for Go generics (type parameters), enabling gotests to generate tests for generic functions and methods on generic types.

✨ Key Features
  • 🔧 Generic Functions: Generate tests for functions with type parameters

    func FindFirst[T comparable](slice []T, target T) (int, error)
  • 🏗️ Generic Types: Support for methods on generic types

    type Set[T comparable] struct { ... }
    func (s *Set[T]) Add(v T)
  • 🎯 All Constraint Types: any, comparable, union types (int64 | float64), approximation (~int)

  • 🧠 Smart Type Mapping: Intelligent defaults for type instantiation

    • anyint
    • comparablestring
    • Union types → first option
    • Approximation → underlying type
  • 🔄 Multiple Type Parameters: Handles functions like Pair[T, U any]

📊 Test Coverage
  • 97.5% main package coverage
  • 83.5% overall project coverage
  • 100% coverage on all new parser functions
  • ✅ 8 comprehensive generic test patterns
🔧 Technical Improvements

Parser Enhancements:

  • New parseTypeDecls() extracts type parameters from type declarations
  • New parseTypeParams() parses AST field lists
  • New extractBaseTypeName() handles receiver types

Template Functions:

  • TypeArgs - generates concrete type arguments for calls
  • FieldType - substitutes type parameters in field declarations
  • ReceiverType - substitutes type parameters in receiver instantiations

Model Updates:

  • New TypeParam struct
  • Added TypeParams field to Function
  • Helper methods: IsGeneric(), HasGenericReceiver()
📚 Documentation

Added comprehensive "Go Generics Support" section to README with:

  • Example: Generic function test generation
  • Example: Methods on generic types
  • Type constraint mapping reference
🐛 Fixes

Closes #​165

📦 Installation
go install github.com/cweill/gotests/gotests@v1.8.0
🙏 Credits

🤖 Developed with assistance from Claude Code


Full Changelog: cweill/gotests@v1.7.0...v1.8.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot enabled auto-merge (squash) October 24, 2025 13:07
@renovate renovate bot merged commit 453fb05 into main Oct 24, 2025
10 of 11 checks passed
@renovate renovate bot deleted the renovate/github.com-cweill-gotests-1.x branch October 24, 2025 13:08
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