Skip to content

Conversation

@ghosind
Copy link
Owner

@ghosind ghosind commented Sep 5, 2025

For #6

Signed-off-by: Chen Su <ghosind@gmail.com>
Signed-off-by: Chen Su <ghosind@gmail.com>
@ghosind ghosind added this to the v1.1.0 milestone Sep 5, 2025
@ghosind ghosind requested a review from Copilot September 5, 2025 01:11
@ghosind ghosind self-assigned this Sep 5, 2025
@ghosind ghosind added the enhancement New feature or request label Sep 5, 2025
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 a fallback function pattern to the go-async library that tries functions in sequence until one succeeds. The implementation includes both context-aware and standard variants along with comprehensive tests and documentation.

  • Adds Fallback and FallbackWithContext functions that execute functions sequentially until one succeeds
  • Provides comprehensive test coverage including success, failure, and context scenarios
  • Updates documentation to include the new fallback functionality

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
fallback.go Core implementation of fallback functions with sequential execution logic
fallback_test.go Comprehensive test suite covering success, failure, and context scenarios
README.md Updated function list to include Fallback function
README-CN.md Updated Chinese documentation with function list and missing note section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (40b4f2f) to head (e185c51).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
+ Coverage   99.01%   99.03%   +0.02%     
==========================================
  Files          13       14       +1     
  Lines         710      725      +15     
==========================================
+ Hits          703      718      +15     
  Misses          6        6              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ghosind ghosind merged commit 29f5ddf into main Sep 5, 2025
22 checks passed
@ghosind ghosind deleted the feat/fallback branch September 5, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant