Skip to content

Add bdd.First(), bdd.Second() and bdd.Third() helper functions#35

Merged
maargenton merged 4 commits intomasterfrom
maa/utils
Feb 22, 2026
Merged

Add bdd.First(), bdd.Second() and bdd.Third() helper functions#35
maargenton merged 4 commits intomasterfrom
maa/utils

Conversation

@maargenton
Copy link
Owner

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds three helper functions (First(), Second(), and Third()) to the bdd package that extract individual values from multi-value return functions. These utilities are particularly useful in test assertions where you want to test a specific return value from a function that returns multiple values.

Changes:

  • Added First(), Second(), and Third() helper functions using generics and variadic parameters to handle multi-value returns
  • Added comprehensive BDD-style tests for all three functions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/bdd/utils.go Added three generic helper functions to extract the first, second, or third value from multi-value return functions
pkg/bdd/utils_test.go Added test coverage using BDD-style tests that verify each helper function extracts the correct value from a 3-value return function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maargenton maargenton merged commit e67d114 into master Feb 22, 2026
12 checks passed
@maargenton maargenton deleted the maa/utils branch February 22, 2026 20:46
@maargenton
Copy link
Owner Author

Released in v1.6.0

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